@RaymanPy

Flask UnicodeDecodeError 'UTF-8' при запуске сервера?

from flask import Flask

app = Flask(__name__)
app.run()


* Serving Flask app "app" (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\Rizvan\Desktop\Flask\app\app.py", line 6, in
app.run()
File "C:\Users\Rizvan\Desktop\Flask\venv\lib\site-packages\flask\app.py", line 943, in run
run_simple(host, port, self, **options)
File "C:\Users\Rizvan\Desktop\Flask\venv\lib\site-packages\werkzeug\serving.py", line 814, in run_simple
inner()
File "C:\Users\Rizvan\Desktop\Flask\venv\lib\site-packages\werkzeug\serving.py", line 774, in inner
fd=fd)
File "C:\Users\Rizvan\Desktop\Flask\venv\lib\site-packages\werkzeug\serving.py", line 660, in make_server
passthrough_errors, ssl_context, fd=fd)
File "C:\Users\Rizvan\Desktop\Flask\venv\lib\site-packages\werkzeug\serving.py", line 577, in __init__
self.address_family), handler)
File "d:\anaconda\Lib\socketserver.py", line 453, in __init__
self.server_bind()
File "d:\anaconda\Lib\http\server.py", line 138, in server_bind
self.server_name = socket.getfqdn(host)
File "d:\anaconda\Lib\socket.py", line 673, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 7: invalid continuation byte

При запуске Flask сервера вылезает вот такая вот ошибка .
  • Вопрос задан
  • 1638 просмотров
Решения вопроса 1
sergey-gornostaev
@sergey-gornostaev Куратор тега Python
Седой и строгий
Проблема в том, что имя вашего компьютера содержит кириллические символы.

Hostnames are composed of series of labels concatenated with dots, as are all domain names. For example, "en.wikipedia.org" is a hostname. Each label must be between 1 and 63 characters long, and the entire hostname (including the delimiting dots but not a trailing dot) has a maximum of 253 ASCII characters.

The Internet standards for protocols mandate that component hostname labels may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits '0' through '9', and the hyphen ('-'). The original specification of hostnames in RFC 952, mandated that labels could not start with a digit or with a hyphen, and must not end with a hyphen. However, a subsequent specification (RFC 1123) permitted hostname labels to start with digits. No other symbols, punctuation characters, or white space are permitted.
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы
23 нояб. 2024, в 01:31
1000 руб./за проект
23 нояб. 2024, в 00:16
2000 руб./за проект
22 нояб. 2024, в 23:55
3000 руб./за проект