[issue21925] ResourceWarning sometimes doesn't display

2016-03-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset f474898ef6de by Victor Stinner in branch '3.5': Issue #21925: Fix test_warnings for release mode https://hg.python.org/cpython/rev/f474898ef6de -- ___ Python tracker _

[issue21925] ResourceWarning sometimes doesn't display

2016-03-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 307ba4afd0a6 by Victor Stinner in branch 'default': Issue #21925: Fix test_warnings for release mode https://hg.python.org/cpython/rev/307ba4afd0a6 -- ___ Python tracker

[issue21925] ResourceWarning sometimes doesn't display

2016-03-24 Thread STINNER Victor
STINNER Victor added the comment: I fixed warnings.formatwarning(). I don't expect the code to be perfect (Python shutdown process is complex and fragile), but the fix is quite simple and it's enough to fix the bug described in the initial message. I even added an unit test for it. I didn't t

[issue21925] ResourceWarning sometimes doesn't display

2016-03-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1de90a7065ba by Victor Stinner in branch '3.5': warnings.formatwarning(): catch exceptions https://hg.python.org/cpython/rev/1de90a7065ba New changeset 36be356f6253 by Victor Stinner in branch 'default': Merge 3.5 https://hg.python.org/cpython/rev/3

[issue21925] ResourceWarning sometimes doesn't display

2016-03-24 Thread STINNER Victor
STINNER Victor added the comment: It looks like logging a warning at Python exit always works on Python 2.7: --- import _warnings class Bla: def __del__(self, w=_warnings): w.warn_explicit('message', DeprecationWarning, 'x.py', 5) bla = Bla() --- It looks like it uses the Python im

[issue21925] ResourceWarning sometimes doesn't display

2016-03-24 Thread STINNER Victor
STINNER Victor added the comment: See also the issue #26637: "importlib: better error message when import fail during Python shutdown". -- ___ Python tracker ___ ___

[issue21925] ResourceWarning sometimes doesn't display

2016-03-24 Thread STINNER Victor
STINNER Victor added the comment: It looks like the warnings is logged when the C implemention is used. When the Python implementation is used, "import linecache" or "linecache.getline()" fail, and so the warnings is skipped. Attached patch makes the Python implementation safer when Python is

[issue21925] ResourceWarning sometimes doesn't display

2014-07-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be save the timestamp for module importing and then clean up modules them in reversed order? -- nosy: +serhiy.storchaka ___ Python tracker __

[issue21925] ResourceWarning sometimes doesn't display

2014-07-13 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever title: ResouceWarning sometimes doesn't display -> ResourceWarning sometimes doesn't display versions: +Python 3.5 ___ Python tracker ___