Message201534
By the way, the filename of the warning is not really useful. Example script test.py:
---------------------
f = open(__file__)
---------------------
At exit, Python displays:
---------------------
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='test.py' mode='r' encoding='UTF-8'>
---------------------
"sys" is not a real file, _Py_DisplaySourceLine() would not be able to display the Python line (the correct filename is test.py).
Python traceback when the warning is emitted, according to gdb:
---------------------
(gdb) py-bt
Traceback (most recent call first):
<built-in method _dealloc_warn of _io.FileIO object at remote 0x7ffff1a04368>
<built-in method _dealloc_warn of _io.BufferedReader object at remote 0x7ffff1ae4838>
<built-in method close of _io.TextIOWrapper object at remote 0x7ffff1b97dc0>
---------------------
We are in PyImport_Cleanup(), called by Py_Finalize(). |
|
Date |
User |
Action |
Args |
2013-10-28 12:56:45 | vstinner | set | recipients:
+ vstinner, pitrou |
2013-10-28 12:56:45 | vstinner | set | messageid: <1382965005.47.0.406441532744.issue19421@psf.upfronthosting.co.za> |
2013-10-28 12:56:45 | vstinner | link | issue19421 messages |
2013-10-28 12:56:45 | vstinner | create | |
|