[issue19077] More robust TemporaryDirectory cleanup

2014-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your patch Antoine. And thank you for your excellent idea Richard. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue19077] More robust TemporaryDirectory cleanup

2014-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 50aa9e3ab9a4 by Serhiy Storchaka in branch '3.3': Issue #19077: tempfile.TemporaryDirectory cleanup is now most likely http://hg.python.org/cpython/rev/50aa9e3ab9a4 New changeset d792eb3afa58 by Serhiy Storchaka in branch 'default': Issue #19077: te

[issue19077] More robust TemporaryDirectory cleanup

2014-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yeah, I thought about it. Only flag should be false in shutdown mode, because it will be None when a module will be cleaned. -- ___ Python tracker __

[issue19077] More robust TemporaryDirectory cleanup

2014-01-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Here are updated patches for 3.3 and 3.4. Changed tests for 3.4, a patch for > 3.3 is changed more. Unfortunately in 3.3 exceptions still can be raised when > try to emit a warning during shutdown. Is there any way to determine the > shutdown mode? There's

[issue19077] More robust TemporaryDirectory cleanup

2014-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here are updated patches for 3.3 and 3.4. Changed tests for 3.4, a patch for 3.3 is changed more. Unfortunately in 3.3 exceptions still can be raised when try to emit a warning during shutdown. Is there any way to determine the shutdown mode? -- Add

[issue19077] More robust TemporaryDirectory cleanup

2014-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Excellent, Antoine! Here is a patch for 3.3 with tests based on Antoine's patch. My changes to tests: * TemporaryDirectory instance is preserved as attributes of several modules. So some modules can be destroyed before cleaning up temporary directory. * Re

[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a working patch for the finalize-based approach. -- Added file: http://bugs.python.org/file33392/tempdir_finalize.patch ___ Python tracker _

[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Note the finalize-based patch can only work on 3.4. -- nosy: +pitrou ___ Python tracker ___ ___ Pyth

[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which implements Richard's suggestion. test_del_on_shutdown and test_warnings_on_cleanup are failed, but perhaps they are wrong. -- Added file: http://bugs.python.org/file33379/tempfile_tempdir_cleanup_weakref_finalize.patch

[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: An alternative with weakref.finalize() looks very attractive, but unfortunately tests are failed with it. -- ___ Python tracker ___ _

[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch to tip. -- Added file: http://bugs.python.org/file33378/tempfile_tempdir_cleanup.patch ___ Python tracker ___ __

[issue19077] More robust TemporaryDirectory cleanup

2014-01-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file31848/tempfile_tempdir_cleanup.patch ___ Python tracker ___ ___ Python-

[issue19077] More robust TemporaryDirectory cleanup

2013-09-25 Thread Nick Coghlan
Nick Coghlan added the comment: Sounds good to me! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue19077] More robust TemporaryDirectory cleanup

2013-09-25 Thread Richard Oudkerk
Richard Oudkerk added the comment: An alternative would be to use weakref.finalize() which would guarantee that cleanup happens before any purging occurs. That would allow the use of shutil: class TemporaryDirectory(object): def __init__(self, suffix="", prefix=template, dir=None):

[issue19077] More robust TemporaryDirectory cleanup

2013-09-24 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue19077] More robust TemporaryDirectory cleanup

2013-09-23 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: The proposed patch solves the problem with TemporaryDirectory cleanup. If shutil.rmtree() failed because module globals are set to None, TemporaryDirectory now uses own rmtree implementation which does not depends from globals. The patch also fixes other m