This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sdaoden
Recipients georg.brandl, r.david.murray, sdaoden, twouters
Date 2011-03-28.12:26:28
SpamBayes Score 1.2456019e-08
Marked as misclassified No
Message-id <1301315190.34.0.276151285444.issue11700@psf.upfronthosting.co.za>
In-reply-to
Content
I'll send a patch that updates/fixes handling of
file closes in the internal proxy-file classes.
It could cause errors yet because self._file is
del-eted but that field may still be used afterwards.


>>> mb = mailbox.Maildir('sdaoden', create=False)
>>> mbf = mb.get_file(mb.keys()[0])
>>> msg = email.parser.BytesParser().parse(mbf, headersonly=True)
>>> mbf.close()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/steffen/usr/opt/py3k/lib/python3.3/mailbox.py", line 1922, in close
    if hasattr(self._file, 'close'):
AttributeError: '_ProxyFile' object has no attribute '_file'


The patched version will always act correctly.
And yes, i'll open yet another issue due to the
email.parser (or even TextIOWrapper) based problem.
History
Date User Action Args
2011-03-28 12:26:30sdaodensetrecipients: + sdaoden, twouters, georg.brandl, r.david.murray
2011-03-28 12:26:30sdaodensetmessageid: <1301315190.34.0.276151285444.issue11700@psf.upfronthosting.co.za>
2011-03-28 12:26:28sdaodenlinkissue11700 messages
2011-03-28 12:26:28sdaodencreate