Message201534
| Author |
vstinner |
| Recipients |
pitrou, vstinner |
| Date |
2013年10月28日.12:56:45 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1382965005.47.0.406441532744.issue19421@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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(). |
|
History
|
|---|
| 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 |
|