Author mclander
Recipients mclander
Date 2012-01-29.22:18:06
SpamBayes Score 1.23014e-05
Marked as misclassified No
Message-id <1327875487.38.0.0330076110954.issue13906@psf.upfronthosting.co.za>
In-reply-to
Content
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>
    class SimpleHTTPRequestHandler(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_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)


---------- here after changes -----------------

F:\>c:\python27\python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
mc-quad - - [30/Jan/2012 02:02:18] "GET / HTTP/1.1" 200 -
mc-quad - - [30/Jan/2012 02:02:18] code 404, message File not found
mc-quad - - [30/Jan/2012 02:02:18] "GET /favicon.ico HTTP/1.1" 404 -
History
Date User Action Args
2012-01-29 22:18:07mclandersetrecipients: + mclander
2012-01-29 22:18:07mclandersetmessageid: <1327875487.38.0.0330076110954.issue13906@psf.upfronthosting.co.za>
2012-01-29 22:18:06mclanderlinkissue13906 messages
2012-01-29 22:18:06mclandercreate