mkhrResearch / webssh

Web based ssh client
https://webssh.huashengdun.org/
MIT License
0 stars 0 forks source link

ace コマンドでバイナリファイルを開くとUnicodeDecodeErrorが発生する #7

Open igaki opened 5 years ago

igaki commented 5 years ago

ace Test.class とか実行するとpython側で↓のような例外が発生する.

[E 181226 11:33:37 web:1670] Uncaught exception POST /getfile (127.0.0.1) HTTPServerRequest(protocol='http', host='localhost:2000', method='POST', uri='/getfile', version='HTTP/1.1', remote_ip='127.0.0.1') Traceback (most recent call last): File "/home/igaki/venv/webssh/lib/python3.6/site-packages/tornado-5.1.1-py3.6-linux-x86_64.egg/tornado/web.py", line 1592, in _execute result = yield result File "/home/igaki/venv/webssh/lib/python3.6/site-packages/tornado-5.1.1-py3.6-linux-x86_64.egg/tornado/gen.py", line 1133, in run value = future.result() File "/home/igaki/venv/webssh/lib/python3.6/site-packages/tornado-5.1.1-py3.6-linux-x86_64.egg/tornado/gen.py", line 307, in wrapper result = func(*args, *kwargs) File "/usr/lib/python3.6/types.py", line 248, in wrapped coro = func(args, **kwargs) File "/mnt/c/linux/ubuntu_home/webssh/webssh/handler.py", line 565, in post self.write({"editor" : result.decode('utf-8'),"status":"ace","filepath":filepath}) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 0: invalid continuation byte

igaki commented 5 years ago

多分,この例外がでたときはそのまま握りつぶすか,ターミナルに例外発生のメッセージを出せばOKかと思われる(msg.statusに書き込みすればよい?)