sax barfs on unicode filenames

"Martin v. Löwis" martin at
Wed Oct 4 23:31:39 CEST 2006

Fredrik Lundh schrieb:
> Martin v. Löwis wrote:
>> Yes. While you can pass Unicode strings as file names to many Python
>> functions, you can't pass them to Expat, as Expat requires the file name
>> as a byte string. Hence the error.
> sounds like a bug in the xml.sax layer, really (ET also uses Expat, and
> doesn't seem to have any problems dealing with unicode filenames...)

That's because ET never invokes XML_SetBase. Without testing, this
suggests that there might be problem in ET with relative URIs
in parsed external entities. XML_SetBase expects a char* for the
base URI.


More information about the Python-list mailing list