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 ncoghlan
Recipients belopolsky, christian.heimes, ncoghlan
Date 2008-02-09.15:32:00
SpamBayes Score 0.004651489
Marked as misclassified No
Message-id <1202571122.52.0.695871006547.issue2021@psf.upfronthosting.co.za>
In-reply-to
Content
I've changed the issue type from rfe to behaviour. NamedTemporaryFile
actually provides __enter__ and __exit__ methods in 2.5, they just don't
work (it tries to use the methods from the underlying file object
directly which turns out to be a doomed exercise for a couple of
different reasons).

Fixed on the trunk in r60695. Leaving issue as pending until the
NamedTemporaryFile fix is backported to 2.5 (or we decide not to
backport it).

P.S. Alexander's patch worked as written, but in figuring out *why* it
worked I ended up moving things around a bit (main change was to only
override __exit__ when it was actually necessary to do so) and adding
some more test cases (e.g. to also cover 2.6's new SpooledTemporaryFile).
History
Date User Action Args
2008-02-09 15:32:02ncoghlansetspambayes_score: 0.00465149 -> 0.004651489
recipients: + ncoghlan, belopolsky, christian.heimes
2008-02-09 15:32:02ncoghlansetspambayes_score: 0.00465149 -> 0.00465149
messageid: <1202571122.52.0.695871006547.issue2021@psf.upfronthosting.co.za>
2008-02-09 15:32:01ncoghlanlinkissue2021 messages
2008-02-09 15:32:00ncoghlancreate