commit | ef9c0e732fc50aefbdd7c5a80e04e14b31684e66 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@gmail.com> | Fri May 05 09:46:47 2017 +0200 |
committer | GitHub <noreply@github.com> | Fri May 05 09:46:47 2017 +0200 |
tree | a59653d14c060ab0037012529ccc678ee8049b96 | |
parent | 7186cc29be352bed6f1110873283d073fd0643e4 [diff] |
bpo-30264: ExpatParser closes the source on error (#1451) ExpatParser.parse() of xml.sax.xmlreader now always closes the source: close the file object or the urllib object if source is a string (not an open file-like object). The change fixes a ResourceWarning on parsing error. Add test_parse_close_source() unit test.