New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xml.sax.saxutils.prepare_input_source ignores character stream in InputSource #45824
Comments
In the documentation for xml.sax.xmlreader.InputSource objects
prepare_input_source() skips step 1. This is a one-line fix in Lib/xml/sax/saxutils.py:
|
Oops, obvious typo, sorry:
|
Could you please provide a simple little test case for the bug? I'd |
Sure. Here is a simple test case: def testUseCharacterStream(self):
'''If the source is an InputSource with a character stream, use
it.'''
src = xml.sax.xmlreader.InputSource(temp_file_name)
src.setCharacterStream(StringIO.StringIO(u"foo"))
prep = xml.sax.saxutils.prepare_input_source(src)
self.failIf(prep.getCharacterStream() is None, "ignored character
stream") If "temp_file_name" is omitted, you'll get an I'm attaching an almost full set of tests. Unfortunately, I now see that the problem |
Are this and the other issues still problems in 2.7 (rc out now) and 3.1? |
Fixed in bpo-2175. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: