sax barfs on unicode filenames

Fredrik Lundh fredrik at pythonware.com
Wed Oct 4 10:55:28 EDT 2006


Diez B. Roggisch wrote:

> Filenames are expected to be bytestrings. So what happens is that the
> unicode string you pass as filename gets implicitly converted using the
> default encoding.

it is ?

>>> f = open(u"\u8116", "w")
>>> f.write("hello")
>>> f.close()

>>> f = open(u"\u8116", "r")
>>> f.read()
'hello'

</F> 






More information about the Python-list mailing list