Hi.
I have programmed a web app for serving some files. Some of these
files contain international characters. Here's the weird thing:
Everything seems to work okay when I'm developing. However when I try
it on lighttpd using fcgi I get the following exception:
item_path = os.path.join(dirpath, item)
File "/usr/lib/python2.7/posixpath.py", line 71, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
8: ordinal not in range(128)
Where the variable item stems from os.listdir.
I can get it to work in lighttpd by cleverly using
item.decode('utf-8') every time I get it from os.listdir and
item.encode('utf-8') every time I need to call os.path.getsize or
os.path.isdir (basically any method which uses os.stat). But then I
get an exception in the standalone server.
Has anyone experienced anything like this?
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.