[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-20 Thread STINNER Victor
STINNER Victor added the comment: Cool, test_warnings, test_logging, etc. pass again on Windows buildbots. I close the issue. As I wrote, I opened a second issue for socket & os.scandir. -- resolution: -> fixed status: open -> closed ___ Python tra

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2428d794b0e1 by Victor Stinner in branch 'default': On ResourceWarning, log traceback where the object was allocated https://hg.python.org/cpython/rev/2428d794b0e1 -- nosy: +python-dev ___ Python tracker

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread STINNER Victor
STINNER Victor added the comment: It looks like io.FileIO has a strong implementation of the destructor. If the object becomes alive again because of random code called in the destructor, the object is not removed. socket and os.scandir have a classical unsafe destructor. Moreover, I'm no mor

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread STINNER Victor
STINNER Victor added the comment: I used this patch to identify a ResourceWarning in test_faulthandler when the test is interrupted by CTRL+c: it's really efficient! I will be very useful to identify all ResourceWarning that I saw in test_asyncio, like the ones seen on the AIX buildbot. -

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread STINNER Victor
STINNER Victor added the comment: When warnings._showwarnmsg(), the io.FileIO object is not closed yet, so all attributes are accessible, which can be useful. Hopefully, the file is closed even if it is kept alive by the warning logger. So maybe it's ok to keep the Python object alive, if the

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 543639cdfdb9 by Victor Stinner in branch 'default': Try again to fix test_warnings on Windows https://hg.python.org/cpython/rev/543639cdfdb9 -- ___ Python tracker

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 691fba640266 by Victor Stinner in branch 'default': Issue #26567: enhance ResourceWarning example https://hg.python.org/cpython/rev/691fba640266 -- ___ Python tracker

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset b8acf98beca9 by Victor Stinner in branch 'default': Try to fix test_warnings on Windows https://hg.python.org/cpython/rev/b8acf98beca9 -- ___ Python tracker __

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-18 Thread STINNER Victor
STINNER Victor added the comment: For socket & scandir, I opened the issue #26590: "socket destructor: implement finalizer". -- ___ Python tracker ___ __

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-15 Thread STINNER Victor
STINNER Victor added the comment: > Backward-compatibility problem: The C function PyErr_ResourceWarning() always > call warnings.showwarning() with the keyword parameter source. If an > application replaces the warnings.showwarning() function, it will probably > fail because it doesn't know t

[issue26567] ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted

2016-03-15 Thread STINNER Victor
Changes by STINNER Victor : -- title: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted -> ResourceWarning: Use tracemalloc to display the traceback where an object was allocated when a ResourceWarning is emitted