急救急救,flask报错,卡了两天了,搞不动
来源:2-4 .第一个flask程序

纵横梦魇4417247
2017-09-17
#coding:utf-8
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
if __name__ == '__main__':
app.run()
以下是报错信息
D:\Today_Venvs\Today_Venv\Scripts\python.exe D:/today/app/flask_test.py
Traceback (most recent call last):
File "D:/today/app/flask_test.py", line 10, in <module>
app.run()
File "D:\Today_Venvs\Today_Venv\lib\site-packages\flask\app.py", line 841, in run
run_simple(host, port, self, **options)
File "D:\Today_Venvs\Today_Venv\lib\site-packages\werkzeug\serving.py", line 739, in run_simple
inner()
File "D:\Today_Venvs\Today_Venv\lib\site-packages\werkzeug\serving.py", line 699, in inner
fd=fd)
File "D:\Today_Venvs\Today_Venv\lib\site-packages\werkzeug\serving.py", line 593, in make_server
passthrough_errors, ssl_context, fd=fd)
File "D:\Today_Venvs\Today_Venv\lib\site-packages\werkzeug\serving.py", line 504, in __init__
HTTPServer.__init__(self, (host, int(port)), handler)
File "D:\Python 3.6\lib\socketserver.py", line 453, in __init__
self.server_bind()
File "D:\Python 3.6\lib\http\server.py", line 138, in server_bind
self.server_name = socket.getfqdn(host)
File "D:\Python 3.6\lib\socket.py", line 673, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbd in position 0: invalid start byte
Process finished with exit code 1
2回答
-
rustgopy
2017-09-17
同学,你好,使用# coding:utf8
022017-09-17 -
纵横梦魇4417247
提问者
2017-09-17
python3
00
相似问题