[issue12811] Tabnanny doesn't close its tokenize files properly
Anthony Briggs
report at bugs.python.org
Mon Aug 22 08:07:54 CEST 2011
New submission from Anthony Briggs <anthony.briggs at gmail.com>:
Unlike Python 2, Python 3 warns when files aren't closed properly, which raises lots of warnings when running tabnanny:
~/devinabox/cpython$ ./python -m tabnanny Lib/
/home/anthony/devinabox/cpython/Lib/tabnanny.py:93: ResourceWarning: unclosed file <_io.TextIOWrapper name='Lib/sunau.py' mode='r' encoding='utf-8'>
check(fullname)
/home/anthony/devinabox/cpython/Lib/tabnanny.py:93: ResourceWarning: unclosed file <_io.TextIOWrapper name='Lib/sre_compile.py' mode='r' encoding='utf-8'>
check(fullname)
/home/anthony/devinabox/cpython/Lib/tabnanny.py:93: ResourceWarning: unclosed file <_io.TextIOWrapper name='Lib/this.py' mode='r' encoding='utf-8'>
check(fullname)
/home/anthony/devinabox/cpython/Lib/tabnanny.py:93: ResourceWarning: unclosed file <_io.TextIOWrapper name='Lib/difflib.py' mode='r' encoding='utf-8'>
check(fullname)
The attached patch fixes the problem.
----------
components: Library (Lib)
files: tabnanny_close_file.patch
keywords: patch
messages: 142681
nosy: anthonyb, ncoghlan
priority: normal
severity: normal
status: open
title: Tabnanny doesn't close its tokenize files properly
type: resource usage
versions: Python 3.3
Added file: http://bugs.python.org/file22992/tabnanny_close_file.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12811>
_______________________________________
More information about the Python-bugs-list
mailing list