[New-bugs-announce] [issue7627] mailbox.MH.remove() lock handling is broken

Rob Austein report at bugs.python.org
Mon Jan 4 01:25:11 CET 2010

New submission from Rob Austein <sra at hactrn.net>:

.remove() method of MH class in the mailbox module of the standard library references a file object after closing it.  This throws a ValueError exception (I/O operation on closed file).

The f.close() call just before the os.remove() call in the innermost try: block should just be removed, the finally: clause of the outer try: block will clean things up correctly.  As far as I know it is completely legal (if slightly unusual) to delete an open file on any unix-like operating system, and the locking semantics won't work correctly otherwise in any case.

components: Library (Lib)
messages: 97185
nosy: sraustein
severity: normal
status: open
title: mailbox.MH.remove() lock handling is broken
type: behavior
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list