[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: A test still fails under Windows: == FAIL: test_warnings_on_cleanup (test.test_tempfile.test_TemporaryDirectory)

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-13 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Ah, yes, I failed to account for the additional string escaping performed by the IO stream. I think I've been bitten by that before, but I always forget since I try to always use forward slashes for paths, even on Windows. r87212 modifies the

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-12 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Tidy ups committed in r87182. Shutdown problems now result in a slightly more meaningful message on stderr, a ResourceWarning is triggered when an implicit teardown occurs and the chances of an AttributeError due to an exception in __init__

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-12 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: The tests are failing on windows: http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/3770/steps/test/logs/stdio == ERROR: test_mkdtemp_failure

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-12 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: There's also a typo in the issue number in your commit message (10888 instead of 10188). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10188

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-12 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Sorry, I realised after I had logged off and gone to bed that I hadn't finished the last test. Fixed in r87204 with an approach that should exercise the relevant behaviour regardless of platform. The commit message has also been updated to

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-11 Thread Jurko Gospodnetić
Jurko Gospodnetić jurko.gospodne...@gmail.com added the comment: Also this class, because it defines __del__ too simply, will display a user-unfriendly error message when cleaning up a TemporaryDirectory object whose constructor raised an exception when attempting to create its temporary

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-11 Thread Jurko Gospodnetić
Jurko Gospodnetić jurko.gospodne...@gmail.com added the comment: Clicked send too soon on the previous comment. :-( The simplest way I see you can fix the __del__ issue is to patch TemporaryDirectory.__init__() as follows: def __init__(self, suffix=, prefix=template, dir=None):

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-11 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Applied the fix from msg123808 in r87172. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10188 ___

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-11 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: I have a slightly better fix for that coming soon. There's a subtle race condition in the proposed approach that can lead to the temporary dir not being deleted if an asynchronous exception, such as KeyboardInterrupt, arrives after mkdtemp

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-12-11 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Although it may be better to just raise a new, more meaningul, exception and let the runtime take care of ignoring it (since it happens in __del__) -- ___ Python tracker rep...@bugs.python.org

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-10-29 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Shutdown has been a 'forever' problem ;-). It would seem sensible to me to have a fixed end-of-shutdown sequence for essential modules. -- nosy: +terry.reedy ___ Python tracker

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-10-24 Thread Nick Coghlan
New submission from Nick Coghlan ncogh...@gmail.com: During interpreter shutdown, modules can become unusable as module globals are set to None. This is a problem for tempfile.TemporaryDirectory, as it needs working os, os.path and stat modules in order to clean up the filesystem. The class

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-10-24 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Cleanup of sys and __builtin__ is already delayed - this particular issue could be fixed by delaying cleanup of a few more modules, along with the proposed change to GC invocation in issue #1545463. --

[issue10188] tempfile.TemporaryDirectory may throw errors at shutdown

2010-10-24 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10188 ___ ___