On Thu, Mar 3, 2011 at 4:01 AM, Vladimir <veva...@yandex.ru> wrote:

> 1. web browser does not give messages, in command line I see:
> Traceback (most recent call last):
> File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py",
> line 280, in run
>    self.result=application(self.environ, self.start_response)
> File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py",
> line 709, in __call__
>    mime_type=mimetypes.guess_type(file_path)[0]
> File "C:\Python27\lib\mimetypes.py", line 294, in guess_type
>    init()
> File "C:\Python27\lib\mimetypes.py", line 355, in init
>    db.read_windows_registry()
> File "C:\Python27\lib\mimetypes.py", line 259, in
> read_windows_registry
>    for ctype in enum_types(mimedb):
> File "C:\Python27\lib\mimetypes.py", line 249, in  enum_types
>    ctype=ctype.encode(default_encoding) # omit in 3.x!
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe0 in position
> 0: ordinal not in range(128)
>

This looks like a bug in Python. Traceback is showing Python mimetypes
init() trying to read the windows registry and running into trouble. The
code in question isn't even using any parameters passed in from the Django
code calling it, so it's unlikely any change to Django (other than not using
mimetypes guess_type) would help to fix it.

This has come up before on this list, and a workaround was mentioned here:

http://groups.google.com/group/django-users/msg/7fe07998db471693

A real fix I believe would need to be made to the Python library code to
ensure that it doesn't die if the windows registry contains non-ASCII data.

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to