Unicode error in sax parser

Stefan Behnel stefan_ml at behnel.de
Wed Feb 9 14:20:54 CET 2011

Rickard Lindberg, 09.02.2011 14:01:
>>> Did you read my reply?
>> Sorry, it was me who failed to read your question properly.
>> Unicode file names aren't really working well, especially not in Py2.x.
>> Python 3.2 provides many improvements here.
>> I assume your file system encoding is UTF-8? What does
>> sys.getfilesystemencoding() give you?
> My getfilesystemencoding() returns utf-8.

Ok, same here. I tried it with Python 3.1.2 and it works for me.

So I think the right work-around for you in Python 2 is to encode the file 
name using whatever "sys.getfilesystemencoding()" returns.

And I agree with Chris Rebert that you should open a bug against the sax 
package in Python 2.7 on the bug tracker.


More information about the Python-list mailing list