[New-bugs-announce] [issue21925] ResouceWarning sometimes doesn't display

Masami HIRATA report at bugs.python.org
Sun Jul 6 04:49:33 CEST 2014


New submission from Masami HIRATA:

It seems that ResouceWarning about unclosed file handles with '-W all' option sometimes doesn't display.
Is this behaviour normal?

$ uname -a
Linux ashrose 3.2.0-65-generic #99-Ubuntu SMP Fri Jul 4 21:03:29 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ python3.4 --version
Python 3.4.1
$ touch spam.txt
$ echo 'a = open("spam.txt")' >test_warning.py
$
$ python3.4 -W all test_warning.py
$ python3.4 -W all test_warning.py
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='spam.txt' mode='r' encoding='UTF-8'>
$ python3.4 -W all test_warning.py
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='spam.txt' mode='r' encoding='UTF-8'>
$ python3.4 -W all test_warning.py
$ python3.4 -W all test_warning.py
$ python3.4 -W all test_warning.py
$ python3.4 -W all test_warning.py
$ python3.4 -W all test_warning.py
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name='spam.txt' mode='r' encoding='UTF-8'>
$

----------
components: Interpreter Core
messages: 222390
nosy: msmhrt
priority: normal
severity: normal
status: open
title: ResouceWarning sometimes doesn't display
type: resource usage
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21925>
_______________________________________


More information about the New-bugs-announce mailing list