Branch: refs/heads/3.6 Home: https://github.com/python/cpython Commit: 0fe870f3f95ba883b2b06bc0d814bdab8d53df98 https://github.com/python/cpython/commit/0fe870f3f95ba883b2b06bc0d814bdab8d53df98 Author: Victor Stinner <victor.stinner at gmail.com> Date: 2017年05月05日 (2017年5月05日) Changed paths: M Lib/test/test_sax.py M Lib/xml/sax/expatreader.py Log Message: ----------- bpo-30264: ExpatParser closes the source on error (#1451) (#1474) 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. (cherry picked from commit ef9c0e732fc50aefbdd7c5a80e04e14b31684e66)