Message262348
Try attached res_warn.py script to test manually all ResourceWarning warnings.
Ouput of python3.6 -Wd res_warn.py:
--------------------------
text
<_pyio.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'>
res_warn.py:9: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
f = None
buffered
<_pyio.BufferedReader name='/etc/issue'>
res_warn.py:15: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
f=None
raw
<_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
res_warn.py:21: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
f=None
fileio
<_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
res_warn.py:27: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
f=None
--------------------------
Ouput of python3.6 -X tracemalloc=2 -Wd res_warn.py:
--------------------------
text
<_pyio.TextIOWrapper name='/etc/issue' mode='r' encoding='UTF-8'>
res_warn.py:9: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
f = None
Object allocated at (most recent call first):
File "/home/haypo/prog/python/default/Lib/_pyio.py", lineno 209
closefd, opener=opener)
File "res_warn.py", lineno 7
f = _pyio.open(fn, "r")
buffered
<_pyio.BufferedReader name='/etc/issue'>
res_warn.py:15: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
f=None
Object allocated at (most recent call first):
File "/home/haypo/prog/python/default/Lib/_pyio.py", lineno 209
closefd, opener=opener)
File "res_warn.py", lineno 13
f = _pyio.open(fn, "rb")
raw
<_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
res_warn.py:21: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
f=None
Object allocated at (most recent call first):
File "/home/haypo/prog/python/default/Lib/_pyio.py", lineno 209
closefd, opener=opener)
File "res_warn.py", lineno 19
f = _pyio.open(fn, "rb", 0)
fileio
<_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
res_warn.py:27: ResourceWarning: unclosed file <_pyio.FileIO name='/etc/issue' mode='rb' closefd=True>
f=None
Object allocated at (most recent call first):
File "res_warn.py", lineno 25
f = _pyio.FileIO(fn, "rb")
-------------------------- |
|
Date |
User |
Action |
Args |
2016-03-24 14:32:26 | vstinner | set | recipients:
+ vstinner, pitrou, Arfrever, akira, martin.panter, piotr.dobrogost, serhiy.storchaka |
2016-03-24 14:32:26 | vstinner | set | messageid: <1458829946.32.0.524886574288.issue19829@psf.upfronthosting.co.za> |
2016-03-24 14:32:26 | vstinner | link | issue19829 messages |
2016-03-24 14:32:25 | vstinner | create | |
|