1

I tried to run http.server on Windows 10 (Hungarian) and got the following error.

PS D:> python -m http.server 8000 Traceback (most recent call last): File "D:\Python36\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "D:\Python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\Python36\lib\http\server.py", line 1211, in test(HandlerClass=handler_class, port=args.port, bind=args.bind) File "D:\Python36\lib\http\server.py", line 1185, in test with ServerClass(server_address, HandlerClass) as httpd: File "D:\Python36\lib\socketserver.py", line 453, in init self.server_bind() File "D:\Python36\lib\http\server.py", line 138, in server_bind self.server_name = socket.getfqdn(host) File "D:\Python36\lib\socket.py", line 673, in getfqdn hostname, aliases, ipaddrs = gethostbyaddr(name) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 3: invalid continuation byte

What can I do?

Md Johirul Islam
  • 5,042
  • 4
  • 23
  • 56
  • Your computer name having non-ascii characters might be the issue. I feel this might be the case because you referred your Windows 10 to be Hungarian. Possible resolution - change hostname of computer to ascii characters only. Or, use SimpleHttpServer to specify host as something like `127.0.0.1` – Vivek Kalyanarangan Feb 08 '18 at 07:24
  • Thanks a lot. Renaming my computer solved the problem. – Péter Juhász Feb 08 '18 at 17:52

0 Answers0