Closed changzhi1990 closed 1 year ago
Hi, I meet an UnicodeDecodeError when running tl-serve.py. Here is the detailed message:
ubuntu@xx-1:~/zhi/pmu-tools$ sudo ./toplev.py -I 100 -x, -o x.csv stress --vm 1 -c 1 --vm-bytes 1024M & [1] 3084540 stress: info: [3084561] dispatching hogs: 1 cpu, 0 io, 1 vm, 0 hdd warning: 2 results not referenced: 9 10 ubuntu@xx-1:~/zhi/pmu-tools$ ./tl-serve.py x.csv 0.0.0.0 8000 serving at 0.0.0.0 port 8000 until Ctrl-C 192.168.0.254 - - [23/May/2023 16:11:47] "GET / HTTP/1.1" 200 - 192.168.0.254 - - [23/May/2023 16:11:47] "GET /dygraph-combined.js HTTP/1.1" 200 - ---------------------------------------- Exception occurred during processing of request from ('192.168.0.254', 51012) Traceback (most recent call last): File "/usr/lib/python3.10/socketserver.py", line 316, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.10/socketserver.py", line 347, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.10/socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python3.10/socketserver.py", line 747, in __init__ self.handle() File "/usr/lib/python3.10/http/server.py", line 432, in handle self.handle_one_request() File "/usr/lib/python3.10/http/server.py", line 420, in handle_one_request method() File "/home/ubuntu/zhi/pmu-tools/./tl-serve.py", line 284, in do_GET self.serve_file("dygraph-combined.js", "text/javascript") File "/home/ubuntu/zhi/pmu-tools/./tl-serve.py", line 277, in serve_file self.wfile.write(f.read()) File "/usr/lib/python3.10/socketserver.py", line 826, in write self._sock.sendall(b) TypeError: a bytes-like object is required, not 'str' ---------------------------------------- 192.168.0.254 - - [23/May/2023 16:11:47] "GET /toplev.ico HTTP/1.1" 200 - ---------------------------------------- Exception occurred during processing of request from ('192.168.0.254', 51026) Traceback (most recent call last): File "/usr/lib/python3.10/socketserver.py", line 316, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.10/socketserver.py", line 347, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.10/socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python3.10/socketserver.py", line 747, in __init__ self.handle() File "/usr/lib/python3.10/http/server.py", line 432, in handle self.handle_one_request() File "/usr/lib/python3.10/http/server.py", line 420, in handle_one_request method() File "/home/ubuntu/zhi/pmu-tools/./tl-serve.py", line 286, in do_GET self.serve_file("toplev.ico", "image/x-icon") File "/home/ubuntu/zhi/pmu-tools/./tl-serve.py", line 277, in serve_file self.wfile.write(f.read()) File "/usr/lib/python3.10/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 42: invalid start byte ---------------------------------------- 192.168.0.254 - - [23/May/2023 16:11:48] "GET /toplev.ico HTTP/1.1" 200 - ---------------------------------------- Exception occurred during processing of request from ('192.168.0.254', 51036) Traceback (most recent call last): File "/usr/lib/python3.10/socketserver.py", line 316, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.10/socketserver.py", line 347, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.10/socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python3.10/socketserver.py", line 747, in __init__ self.handle() File "/usr/lib/python3.10/http/server.py", line 432, in handle self.handle_one_request() File "/usr/lib/python3.10/http/server.py", line 420, in handle_one_request method() File "/home/ubuntu/zhi/pmu-tools/./tl-serve.py", line 286, in do_GET self.serve_file("toplev.ico", "image/x-icon") File "/home/ubuntu/zhi/pmu-tools/./tl-serve.py", line 277, in serve_file self.wfile.write(f.read()) File "/usr/lib/python3.10/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 42: invalid start byte ----------------------------------------
Has anyone experienced a similar error before? I would greatly appreciate any advice or guidance on how to resolve the issue.
Thanks
Hi, I meet an UnicodeDecodeError when running tl-serve.py. Here is the detailed message:
Has anyone experienced a similar error before? I would greatly appreciate any advice or guidance on how to resolve the issue.
Thanks