G
G
gavnocoder2020-05-16 21:59:17
Flask
gavnocoder, 2020-05-16 21:59:17

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte?

Hello, I decided to learn flask. I did everything as in the tutorial installed python, pycharm, flask.
Got the default code

from flask import Flask

app = Flask(__name__)


@app.route('/')
def index():
    return "hello"


if __name__ == "__main__":
    app.run(debug=True)

Launched and outputs
Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Restarting with stat
* Debugger is active!
* Debugger PIN: 310-245-834
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\Alex\AppData\Local\Programs\Python\Python38-32\lib\threading.py ", line 932, in _bootstrap_inner
self.run()
File "C:\Users\Alex\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
self._target(* self._args, **self._kwargs)
File "C:\Users\Alexander\PycharmProjects\blog\venv\lib\site-packages\werkzeug\serving.py", line 996, in inner
srv = make_server(
File "C:\Users\Alexander\PycharmProjects\blog\ venv\lib\site-packages\werkzeug\serving.py", line 847, in make_server
return ThreadedWSGIServer(
File "C:\Users\PycharmProjects\blog\venv\lib\site-packages\werkzeug\serving.py" , line 740, in __init__
HTTPServer.__init__(self, server_address, handler)
File "C:\Users\Alex\AppData\Local\Programs\Python\Python38-32\lib\socketserver.py", line 452, in __init__
self .server_bind()
File "C:\Users\Alex\AppData\Local\Programs\Python\Python38-32\lib\http\server.py", line 140, in server_bind
self.server_name = socket.getfqdn(host)
File "C:\Users\Alex\AppData\Local\Programs\Python\Python38-32\lib\socket.py", line 756, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr (name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte

Tell me how to fix this error because I watched all sorts of videos and tutorials there everything is easy and simple. Everything works without dancing with a tambourine.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-05-16
@gavnocoder

Well, they already googled the error, it is stably set by Windows users who must suffer.
PS oh, these answerers, look at the error, not the paths there, but the computer name in gethostbyaddr

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question