[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-24 Thread STINNER Victor
STINNER Victor added the comment: Cool, the final code is simpler than before! -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Committed without this test. Thank you Victor and Yury for your comments. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7ea2153eae87 by Serhiy Storchaka in branch '3.4': Issue #22427: TemporaryDirectory no longer attempts to clean up twice when https://hg.python.org/cpython/rev/7ea2153eae87 New changeset e9d4288c32de by Serhiy Storchaka in branch 'default': Issue #22

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-23 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah... you are right. It seems the None test has been superfluous all the time. -- ___ Python tracker ___ ___

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But in this case cleanup() can't be called. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: self._finalizer can be None if an exception was raised during __init__(). -- ___ Python tracker ___

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fixed a bug in the test and partially addressed Victor's and Yury's comments. Antoine, could your pleas answer following question? Is it safe to remove the "self._finalizer is not None" check in cleanup()? I.e. is it possible that self._finalizer becomes Non

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-18 Thread Jakub Wilk
Changes by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is alternative patch. It simplifies TemporaryDirectory instead of complicate it. -- Added file: http://bugs.python.org/file36645/tempfile_exit_on_shutdown2.patch ___ Python tracker

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which may fix this issue. -- keywords: +patch nosy: +pitrou, serhiy.storchaka stage: -> patch review versions: +Python 3.5 Added file: http://bugs.python.org/file36644/tempfile_exit_on_shutdown.patch __

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread Jack O'Connor
Jack O'Connor added the comment: My example script is definitely a corner case, but where this actually came up for me was in asyncio. Using a TemporaryDirectory inside a coroutine creates a similar situation. -- ___ Python tracker

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread STINNER Victor
STINNER Victor added the comment: On Python 3.5 compiled in debug mode (or probably with python -Wd when compiled in release mode), I got this warning: /home/haypo/prog/python/default/Lib/tempfile.py:708: ResourceWarning: Implicitly cleaning up _warnings.warn(warn_message, ResourceWarning)

[issue22427] TemporaryDirectory attempts to clean up twice

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

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-17 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.rosenberg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue22427] TemporaryDirectory attempts to clean up twice

2014-09-16 Thread Jack O'Connor
New submission from Jack O'Connor: The following little script prints (but ignores) a FileNotFoundError. import tempfile def generator(): with tempfile.TemporaryDirectory(): yield g = generator() next(g) Exception ignored in: Traceback (most recent call last): File "gen.py", line