New submission from Anthony Briggs :
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
<http://bugs.python.org/issue12811>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com