N
N
Negro2022-04-01 17:09:24
Python
Negro, 2022-04-01 17:09:24

How to fix encoding error in python 3.8.6 flask?

When I first started using and learning flask, everything was fine, until at one point, every time I ran any script using flask, I started getting the same error:
* Serving Flask app 'main' (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: 126-879-197
Exception in thread Thread-1:
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\threading.py ", line 932, in _bootstrap_inner
self.run()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File " C:\Users\Admin\PycharmProjects\pythonProject4\venv\lib\site-packages\werkzeug\serving.py", line 957, in inner
srv = make_server(
File "C:\Users\Admin\PycharmProjects\pythonProject4\venv\ lib\site-packages\werkzeug\serving.py", line 789, in make_server
return ThreadedWSGIServer(
File "C:\Users\Admin\PycharmProjects\pythonProject4\venv\lib\site-packages\werkzeug\serving.py", line 693, in __init__
super().__init__(server_address, handler) # type: ignore
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\socketserver.py",line 452, in __init__
self.server_bind()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\http\server.py", line 140, in server_bind
self.server_name = socket.getfqdn(host)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\lib\socket.py", line 755, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 0: invalid continuation byte
.
What I just didn’t try: I reinstalled flask and python, changed the encodings of the script, as well as the same socket.py file. Nothing helped!
PLEASE HELP!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question