The delpoy_server.sh script (start_server.py) will crash if provided with a UTF8 PTU using characters > 127
Expected Behavior
The server continues successfully with PTU
Observed Behavior
The server crashes
Error in connection handler
Traceback (most recent call last):
File "/usr/web/python/python_websocket/src/websockets/server.py", line 193, in handler
await self.ws_handler(self, path)
File "/usr/web/python/python_websocket/src/start_server.py", line 149, in on_connect
await rpc_service.on_receive(message)
File "/usr/web/python/python_websocket/src/start_server.py", line 190, in on_receive
print('\033[1;2m***Message received: %s\033[0m' % _msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 19395: ordinal not in range(128)
Browser & Version Information
Browser and Version: python 3.6.9
Generic HMI Version: develop
Test Case, Sample Code, and / or Example App
I believe this crash can be avoided with sys.stdout.reconfigure(encoding='utf-8') in python 3.7 and higher
Bug Report
The delpoy_server.sh script (start_server.py) will crash if provided with a UTF8 PTU using characters > 127
Expected Behavior
The server continues successfully with PTU
Observed Behavior
The server crashes
Browser & Version Information
Test Case, Sample Code, and / or Example App
I believe this crash can be avoided with
sys.stdout.reconfigure(encoding='utf-8')
in python 3.7 and higher