Quentin Gallet-Gilles added the comment: The previous patch is suboptimal and doesn't solve all cases. This one does. My apologies. __________________________________ Tracker <report at bugs.python.org> <http://bugs.python.org/issue1146> __________________________________