运行PYTHON3.5下的开发服务器时提示UnicodedecodeError utf-8错误
C:\Users\ceb\AppData\Local\Programs\Python\Python35\python.exe C:/rgttest/project001/manage.py runserver 8000
Performing system checks...
System check identified no issues (0 silenced).
March 15, 2017 - 14:47:52
Django version 1.8.4, using settings 'project001.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x00000000042CC620>
Traceback (most recent call last):
File "C:\Users\ceb\AppData\Local\Programs\Python\Python35\lib\site-packages\django-1.8.4-py3.5.egg\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\ceb\AppData\Local\Programs\Python\Python35\lib\site-packages\django-1.8.4-py3.5.egg\django\core\management\commands\runserver.py", line 139, in inner_run
ipv6=self.use_ipv6, threading=threading)
File "C:\Users\ceb\AppData\Local\Programs\Python\Python35\lib\site-packages\django-1.8.4-py3.5.egg\django\core\servers\basehttp.py", line 191, in run
httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
File "C:\Users\ceb\AppData\Local\Programs\Python\Python35\lib\site-packages\django-1.8.4-py3.5.egg\django\core\servers\basehttp.py", line 76, in __init__
super(WSGIServer, self).__init__(*args, **kwargs)
File "C:\Users\ceb\AppData\Local\Programs\Python\Python35\lib\socketserver.py", line 443, in __init__
self.server_bind()
File "C:\Users\ceb\AppData\Local\Programs\Python\Python35\lib\site-packages\django-1.8.4-py3.5.egg\django\core\servers\basehttp.py", line 80, in server_bind
super(WSGIServer, self).server_bind()
File "C:\Users\ceb\AppData\Local\Programs\Python\Python35\lib\wsgiref\simple_server.py", line 50, in server_bind
HTTPServer.server_bind(self)
File "C:\Users\ceb\AppData\Local\Programs\Python\Python35\lib\http\server.py", line 140, in server_bind
self.server_name = socket.getfqdn(host)
File "C:\Users\ceb\AppData\Local\Programs\Python\Python35\lib\socket.py", line 658, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbc in position 0: invalid start byte
同样的环境,加两台机器并没有这个问题