Skip to content

[3.6] bpo-30264: ExpatParser closes the source on error (#1451)#1474

Merged
vstinner merged 1 commit into
python:3.6from
vstinner:sax_36
May 5, 2017
Merged

[3.6] bpo-30264: ExpatParser closes the source on error (#1451)#1474
vstinner merged 1 commit into
python:3.6from
vstinner:sax_36

Conversation

@vstinner
Copy link
Copy Markdown
Member

@vstinner vstinner commented May 5, 2017

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 ef9c0e7)

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 ef9c0e7)
@vstinner vstinner merged commit 0fe870f into python:3.6 May 5, 2017
@vstinner vstinner deleted the sax_36 branch May 5, 2017 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants