Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIFO reading: Better compatibility with various Unicode bytes
Some SIP headers such as "User-Agent" may contain Unicode data that would crash the CLI on some OS/Python-3 combinations. For example, an "ul_dump" MI command may run into the following trace: File "/usr/lib/python3/dist-packages/opensipscli/communication/fifo.py", line 77, in execute replycmd = reply_fifo.readline() File "/usr/lib/python3.7/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf2 in position 2737: invalid continuation byte This patch simply changes the default handling of byte-scanning errors, by simply replacing unrecognized characters with a "?" symbol and moving forward.
- Loading branch information