New submission from Vajrasky Kok: This python is compiled with --with-pydebug option.
[sky@localhost cpython]$ cat /tmp/a.txt manly man likes cute cat. [sky@localhost cpython]$ ./python Python 3.4.0a0 (default:e408e821d6c8, Jul 27 2013, 10:49:54) [GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from formatter import test >>> test('/tmp/a.txt') manly man likes cute cat. __main__:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/a.txt' mode='r' encoding='UTF-8'> >>> [sky@localhost cpython]$ ./python Lib/formatter.py /tmp/a.txt manly man likes cute cat. Lib/formatter.py:445: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/a.txt' mode='r' encoding='UTF-8'> test() ---------- components: Tests files: formatter_fix_resource_warning.patch keywords: patch messages: 194260 nosy: vajrasky priority: normal severity: normal status: open title: Got ResourceWarning: unclosed file when using test function from formatter module type: resource usage versions: Python 3.4 Added file: http://bugs.python.org/file31138/formatter_fix_resource_warning.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18644> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com