[issue12811] Tabnanny doesn't close its tokenize files properly

2011-08-22 Thread Anthony Briggs

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



[issue12811] Tabnanny doesn't close its tokenize files properly

2011-08-22 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset c5cb0aa5bed6 by Nick Coghlan in branch 'default':
Fix #12811 by closing files promptly in tabnanny.check. Patch by Anthony Briggs.
http://hg.python.org/cpython/rev/c5cb0aa5bed6

--
nosy: +python-dev

___
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



[issue12811] Tabnanny doesn't close its tokenize files properly

2011-08-22 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
nosy:  -python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
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