Re: odd unicode error
- From: tubby <tubby@xxxxxxxxxxxxxx>
- Date: Thu, 12 Apr 2007 14:54:53 -0400
Martin v. Löwis wrote:
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 1:
ordinal not in range(128)
Any ideas?
path is a Unicode string, b is a byte string and contains the
byte \xd0.
The problem is that you have a directory with file names in it that
cannot be converted to Unicode strings, using the file system
encoding. If you can't fix the file system, you have to make
search_path a byte string.
Regards,
Martin
I fixed it... I didn't tell the whole story. The interface uses wxpython. It returns a unicode pathname that os.walk() uses. I changed that pathname with str() and now, it no longer barfs.
.
- References:
- odd unicode error
- From: tubby
- Re: odd unicode error
- From: "Martin v. Löwis"
- odd unicode error
- Prev by Date: Re: Inconsistent result from urllib.urlopen
- Next by Date: Re: Calling private base methods
- Previous by thread: Re: odd unicode error
- Next by thread: Can anybody give me an example about how to write the image drawn by the canvas in WxPython into postscript file
- Index(es):
Relevant Pages
|