New submission from STINNER Victor:

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.

----------
components: Tests, XML
messages: 292946
nosy: haypo
priority: normal
severity: normal
status: open
title: [Windows] test_sax: Warning -- files was modified by test_sax
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30264>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to