Backporting tempfile.NamedTemporaryFile context management fix
![](https://secure.gravatar.com/avatar/f3ba3ecffd20251d73749afbfa636786.jpg?s=120&d=mm&r=g)
In 2.5, tempfile.NamedTemporaryFile passes requests for __enter__ and __exit__ through to the underlying file object, which ends up breaking in a couple of different ways (by a fortuitous coincidence, it actually works in most respects on Windows, so tempfile.TemporaryFile will mostly do the right thing in with statements no matter what platform you are on). This has been fixed on the trunk in response to issue 2021, but I'm not sure of the current status of the 2.5 maintenance branch. Should I wait until after 2.5.2 is released before backporting? Or backport it now? Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
![](https://secure.gravatar.com/avatar/047f2332cde3730f1ed661eebb0c5686.jpg?s=120&d=mm&r=g)
Assuming the fix isn't going to break other things, I'd say now is the time, unless Martin says otherwise. Waiting until after 2.5.2 doesn't make a lot of sense -- either it is a backportable fix, or it isn't. If it is backportable, it can go in as long as the 2.5.2 code freeze isn't in effect. On Feb 10, 2008 4:53 AM, Nick Coghlan <ncoghlan@gmail.com> wrote:
In 2.5, tempfile.NamedTemporaryFile passes requests for __enter__ and __exit__ through to the underlying file object, which ends up breaking in a couple of different ways (by a fortuitous coincidence, it actually works in most respects on Windows, so tempfile.TemporaryFile will mostly do the right thing in with statements no matter what platform you are on).
This has been fixed on the trunk in response to issue 2021, but I'm not sure of the current status of the 2.5 maintenance branch. Should I wait until after 2.5.2 is released before backporting? Or backport it now?
Cheers, Nick.
-- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
-- --Guido van Rossum (home page: http://www.python.org/~guido/)
![](https://secure.gravatar.com/avatar/3acb8bae5a2b5a28f6fe522a4ea9b873.jpg?s=120&d=mm&r=g)
This has been fixed on the trunk in response to issue 2021, but I'm not sure of the current status of the 2.5 maintenance branch. Should I wait until after 2.5.2 is released before backporting? Or backport it now?
Please backport it now. The code freeze for the 2.5 branch will come Wednesday night; there will be release candidate first. Regards, Martin
participants (3)
-
"Martin v. Löwis"
-
Guido van Rossum
-
Nick Coghlan