[issue6686] xml.sax.xmlreader.XMLReader.getProperty (xml.sax.handler.property_xml_string) returns bytes

2009-08-11 Thread Colin Stewart

New submission from Colin Stewart :

The documentation for the xml.sax.handler.property_xml_string SAX
property states that it should be "data type: String".  However when
retrieving this value in Python 3.1 it returns a bytes object instead.

This makes handling the returned value very difficult because there is
no method for retrieving the character set encoding that the XML was
originally encoded with.

This is currently blocking the port of SimpleTAL to Python 3 achieving
feature parity with Python 2.

--
components: XML
messages: 91482
nosy: cms103
severity: normal
status: open
title: xml.sax.xmlreader.XMLReader.getProperty 
(xml.sax.handler.property_xml_string) returns bytes
type: behavior
versions: Python 3.1

___
Python tracker 
<http://bugs.python.org/issue6686>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6686] xml.sax.xmlreader.XMLReader.getProperty (xml.sax.handler.property_xml_string) returns bytes

2009-08-12 Thread Colin Stewart

Colin Stewart  added the comment:

I'm not familiar with the inner workings of the expat integration with
Python, so the attached patches need careful review.

The first patch (expatreader.py.patch) is the minimum to resolve this
issue.  The second patch (expatreader.py.patch2) also exposes the
version and encoding parameters via the Locator2 interface
(http://www.saxproject.org/apidoc/org/xml/sax/ext/Locator2.html), which
I'd recommend including.

--
keywords: +patch
Added file: http://bugs.python.org/file14701/expatreader.py.patch

___
Python tracker 
<http://bugs.python.org/issue6686>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6686] xml.sax.xmlreader.XMLReader.getProperty (xml.sax.handler.property_xml_string) returns bytes

2009-08-12 Thread Colin Stewart

Colin Stewart  added the comment:

Adding second patch.

--
Added file: http://bugs.python.org/file14702/expatreader.py.patch2

___
Python tracker 
<http://bugs.python.org/issue6686>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com