You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bpo-9291: mimetypes initialization fails on Windows because of non-Latin characters in registry
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2012-01-29.22:27:56.409>created_at=<Date2012-01-29.22:18:06.809>labels= ['type-bug', 'library']
title='mimetypes.py under windows - bad exception catch'updated_at=<Date2012-01-29.22:27:56.407>user='https://bugs.python.org/mclander'
mimetypes.py(249) expectts Unicode*En*codeError, but Unicode*De*codeError happens when registry has non latin symbols (Vista Home 64).
I just change cathc jn next line to UnicodeDecodeError and all now works fine. But may be error not here, but on encode method which raise "negative" exception
F:\>c:\python27\python -m SimpleHTTPServer
Traceback (most recent call last):
File "test.py", line 2, in <module>import SimpleHTTPServer
File "c:\python27\lib\SimpleHTTPServer.py", line 27, in <module>classSimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
File "c:\python27\lib\SimpleHTTPServer.py", line 204, in SimpleHTTPRequestHandler
mimetypes.init() # try to read system mime.types
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_registryfor 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)
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: