Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleHTTPServer: UnicodeDecodeError on Windows 8 (64-bit) #64216

Closed
HugoLol mannequin opened this issue Dec 18, 2013 · 2 comments
Closed

SimpleHTTPServer: UnicodeDecodeError on Windows 8 (64-bit) #64216

HugoLol mannequin opened this issue Dec 18, 2013 · 2 comments

Comments

@HugoLol
Copy link
Mannequin

HugoLol mannequin commented Dec 18, 2013

BPO 20017
Nosy @vstinner, @ezio-melotti
Superseder
  • 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 = None
    closed_at = <Date 2013-12-18.16:34:51.543>
    created_at = <Date 2013-12-18.16:33:28.853>
    labels = ['expert-unicode', 'OS-windows']
    title = 'SimpleHTTPServer: UnicodeDecodeError on Windows 8 (64-bit)'
    updated_at = <Date 2013-12-18.16:34:51.542>
    user = 'https://bugs.python.org/HugoLol'

    bugs.python.org fields:

    activity = <Date 2013-12-18.16:34:51.542>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2013-12-18.16:34:51.543>
    closer = 'vstinner'
    components = ['Unicode', 'Windows']
    creation = <Date 2013-12-18.16:33:28.853>
    creator = 'Hugo.Lol'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 20017
    keywords = []
    message_count = 2.0
    messages = ['206538', '206539']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'ezio.melotti', 'Hugo.Lol']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = '9291'
    type = None
    url = 'https://bugs.python.org/issue20017'
    versions = ['Python 2.7']

    @HugoLol
    Copy link
    Mannequin Author

    HugoLol mannequin commented Dec 18, 2013

    Running Windows 8 (64-bit) and Python 2.7.6 (64-bit).

    > python -m SimpleHTTPServer
    Traceback (most recent call last):
      File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
        "__main__", fname, loader, pkg_name)
      File "C:\Python27\lib\runpy.py", line 72, in _run_code
        exec code in run_globals
      File "C:\Python27\lib\SimpleHTTPServer.py", line 27, in <module>
        class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
      File "C:\Python27\lib\SimpleHTTPServer.py", line 208, in SimpleHTTPRequestHand
    ler
        mimetypes.init() # try to read system mime.types
      File "C:\Python27\lib\mimetypes.py", line 358, in init
        db.read_windows_registry()
      File "C:\Python27\lib\mimetypes.py", line 258, in read_windows_registry
        for subkeyname in enum_types(hkcr):
      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 0xd7 in position 2: ordinal
    not in range(128)

    @vstinner
    Copy link
    Member

    This issue is a duplicate of bpo-9291.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant