Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Problem with UTF8 chars #47

Open
kosztag opened this issue Oct 18, 2020 · 1 comment
Open

Problem with UTF8 chars #47

kosztag opened this issue Oct 18, 2020 · 1 comment

Comments

@kosztag
Copy link

kosztag commented Oct 18, 2020

Hi,

I've just run your app first time and tested.
The following problem shown and app is crashed when I entered to a zone has non-ascii character in name.

Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "/storage/paradox/ParadoxIP150v2/lib/client.py", line 2291, in _thread_main self.loop_forever() File "/storage/paradox/ParadoxIP150v2/lib/client.py", line 1265, in loop_forever rc = self.loop(timeout, max_packets) File "/storage/paradox/ParadoxIP150v2/lib/client.py", line 831, in loop return self.loop_misc() File "/storage/paradox/ParadoxIP150v2/lib/client.py", line 1130, in loop_misc self._message_retry_check() File "/storage/paradox/ParadoxIP150v2/lib/client.py", line 1862, in _message_retry_check self._message_retry_check_actual(self._out_messages, self._out_message_mutex) File "/storage/paradox/ParadoxIP150v2/lib/client.py", line 1850, in _message_retry_check_actual self._send_publish(m.mid, m.topic, m.payload, m.qos, m.retain, m.dup) File "/storage/paradox/ParadoxIP150v2/lib/client.py", line 1688, in _send_publish utopic = topic.encode('utf-8') UnicodeDecodeError: 'ascii' codec can't decode byte 0x9d in position 16: ordinal not in range(128)

@NiOsY
Copy link

NiOsY commented Mar 8, 2022

just add the following to the beginning of the script:

reload(sys)
sys.setdefaultencoding('latin-1')

this does not solve the utf-8 decode problem, but at least the sctipt does not crash.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants