24
Авг
2018

UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xcf in position 5: invalid continuation byte

решил попробовать flask, но на первом же примере наткнулся, как мне кажется, на весьма нераспространенную ошибку.

from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello() -> str:
    return 'Hello world!'

app.run()



C:\Users\hdmi\AppData\Local\Programs\Python\Python36-32\python.exe C:/Users/hdmi/PycharmProjects/headfirst/webapp/hello_flask.py
 * Serving Flask app "hello_flask" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
Traceback (most recent call last):
  File "C:/Users/hdmi/PycharmProjects/headfirst/webapp/hello_flask.py", line 8, in <module>
    app.run()
  File "C:\Users\hdmi\AppData\Roaming\Python\Python36\site-packages\flask\app.py", line 943, in run
    run_simple(host, port, self, **options)
  File "C:\Users\hdmi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\werkzeug\serving.py", line 814, in run_simple
    inner()
  File "C:\Users\hdmi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\werkzeug\serving.py", line 774, in inner
    fd=fd)
  File "C:\Users\hdmi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\werkzeug\serving.py", line 660, in make_server
    passthrough_errors, ssl_context, fd=fd)
  File "C:\Users\hdmi\AppData\Local\Programs\Python\Python36-32\lib\site-packages\werkzeug\serving.py", line 577, in __init__
    self.address_family), handler)
  File "C:\Users\hdmi\AppData\Local\Programs\Python\Python36-32\lib\socketserver.py", line 453, in __init__
    self.server_bind()
  File "C:\Users\hdmi\AppData\Local\Programs\Python\Python36-32\lib\http\server.py", line 138, in server_bind
    self.server_name = socket.getfqdn(host)
  File "C:\Users\hdmi\AppData\Local\Programs\Python\Python36-32\lib\socket.py", line 673, in getfqdn
    hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 5: invalid continuation byte

Буду очень признателен, если кто-нибудь мне разжует суть проблемы

P.S. кириллица не обнаружена!

Источник: https://ru.stackoverflow.com/questions/872951/unicodedecodeerror-utf-8-codec-cant-decode-byte-0xcf-in-position-5-invalid

Тебе может это понравится...

Добавить комментарий