Message292946
Running test_sax of Python 2.7 on Windows emits the following warning:
Warning -- files was modified by test_sax
The problem is that os.unlink(TESTFN) ignores all OSError: os.unlink(TESTFN) fails because there is still an open file object somewhere.
The bug is in the test_parse_bytes() of test_sax, on check_parse(TESTFN) which raises an exception as expected.
xml.sax.parse() should close the parser on exception.
On master, test_sax explicitly expects a ResourceWarning, WTF?
with support.check_warnings(('unclosed file', ResourceWarning)):
# XXX Failed parser leaks an opened file.
with self.assertRaises(SAXException):
self.check_parse(TESTFN)
# Collect leaked file.
gc.collect()
See also issue #15388. |
|
Date |
User |
Action |
Args |
2017-05-03 23:50:04 | vstinner | set | recipients:
+ vstinner |
2017-05-03 23:50:04 | vstinner | set | messageid: <1493855404.54.0.178478037782.issue30264@psf.upfronthosting.co.za> |
2017-05-03 23:50:04 | vstinner | link | issue30264 messages |
2017-05-03 23:50:04 | vstinner | create | |
|