Skip to content

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

Merged
vstinner merged 1 commit into
python:3.5from
vstinner:sax_35
May 5, 2017
Merged

[3.5] bpo-30264: ExpatParser closes the source on error (#1451)#1475
vstinner merged 1 commit into
python:3.5from
vstinner:sax_35

Conversation

@vstinner

@vstinner vstinner commented May 5, 2017

Copy link
Copy Markdown
Member

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