This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jleedev
Recipients durin42, jleedev
Date 2014-08-07.15:06:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
While SimpleHTTPServer from Python2 would happily spit out whatever bytes were in the directory listing, Python3's http.server logs an error and closes the connection without responding to the HTTP request.

$ mkdir $'\xff'
$ ls
$ python3 -m http.server 
Serving HTTP on port 8000 ...
Exception happened during processing of request from ('', 19648)
Traceback (most recent call last):
  File "/home/josh/local/lib/python3.5/", line 321, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/home/josh/local/lib/python3.5/", line 347, in process_request
    self.finish_request(request, client_address)
  File "/home/josh/local/lib/python3.5/", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/home/josh/local/lib/python3.5/", line 681, in __init__
  File "/home/josh/local/lib/python3.5/http/", line 398, in handle
  File "/home/josh/local/lib/python3.5/http/", line 386, in handle_one_request
  File "/home/josh/local/lib/python3.5/http/", line 677, in do_GET
    f = self.send_head()
  File "/home/josh/local/lib/python3.5/http/", line 716, in send_head
    return self.list_directory(path)
  File "/home/josh/local/lib/python3.5/http/", line 772, in list_directory
    % (urllib.parse.quote(linkname), html.escape(displayname)))
  File "/home/josh/local/lib/python3.5/urllib/", line 688, in quote
    string = string.encode(encoding, errors)
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 0: surrogates not allowed
Date User Action Args
2014-08-07 15:06:33jleedevsetrecipients: + jleedev, durin42
2014-08-07 15:06:33jleedevsetmessageid: <>
2014-08-07 15:06:33jleedevlinkissue22165 messages
2014-08-07 15:06:33jleedevcreate