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