R. David Murray <rdmur...@bitdance.com> added the comment: The finally was doing a _sync_close, which flushes the tmp file and closes it. The except Exception is checking if any non-BaseException error occurs, *removing* the tmp file, and re-raising the exception. There's nothing to flush/close in that case. Then, the else: clause of the exception deals with doing the _sync_close if, eg, we had a keyboard interrupt. That may or may not leave the mailbox in a sensible state, but it is no worse than the previous behavior. Certainly for any non-BaseException exception the new code is better; previously you'd most likely wind up with an empty or partially written message tmp file. I'm open to changing to BaseException, though, if you think that would be better (I can see the argument for that).
---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11116> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com