New submission from Rob Austein <s...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue7627>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to