大无语,utf-8无法解编码,主要是这在库里面,而且文件有
# -*- coding : utf-8 -*-
# coding: utf-8
完整报错内容:
Traceback (most recent call last):
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\threadpool.py", line 173, in __run_task
thread_result.set(func(*args, **kwargs))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 0: invalid start byte
2023-06-28T09:38:38Z (<ThreadPoolWorker at 0x21c8b505e08 thread_ident=0x2f14 threadpool-hub=<Hub at 0x21c8b439098 thread_ident=0x4090>>, <built-in function gethostbyaddr>) failed with UnicodeDecodeError
Traceback (most recent call last):
File "C:\Program Files\Python37\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 1, in <module>
File "C:\Program Files\JetBrains\PyCharm 2023.1.2\plugins\python\helpers\pydev\_pydev_bundle\pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2023.1.2\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "X:\other\610web\main.py", line 60, in <module>
server.serve_forever()
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\baseserver.py", line 398, in serve_forever
self.start()
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\baseserver.py", line 336, in start
self.init_socket()
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\pywsgi.py", line 1546, in init_socket
self.update_environ()
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\pywsgi.py", line 1558, in update_environ
name = socket.getfqdn(address[0])
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\_socketcommon.py", line 304, in getfqdn
hostname, aliases, _ = gethostbyaddr(name)
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\_socketcommon.py", line 276, in gethostbyaddr
return get_hub().resolver.gethostbyaddr(ip_address)
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\resolver\thread.py", line 66, in gethostbyaddr
return self.pool.apply(_socket.gethostbyaddr, args, kwargs)
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\pool.py", line 161, in apply
return self.spawn(func, *args, **kwds).get()
File "src\\gevent\\event.py", line 329, in gevent._gevent_cevent.AsyncResult.get
File "src\\gevent\\event.py", line 359, in gevent._gevent_cevent.AsyncResult.get
File "src\\gevent\\event.py", line 347, in gevent._gevent_cevent.AsyncResult.get
File "src\\gevent\\event.py", line 327, in gevent._gevent_cevent.AsyncResult._raise_exception
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\_compat.py", line 66, in reraise
raise value.with_traceback(tb)
File "C:\Users\段禹珩\AppData\Roaming\Python\Python37\site-packages\gevent\threadpool.py", line 173, in __run_task
thread_result.set(func(*args, **kwargs))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 0: invalid start byte