You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on a new module I printed a lot of data to stdout. When run from CLI, it was working fine, when run from GUI, it crashes all the time:
Traceback (most recent call last):
File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "dist.x86_64-pc-linux-gnu/gui/wxpython/core/gconsole.py", line 171, in run
self.resultQ.put((requestId, self.requestCmd.run()))
File "dist.x86_64-pc-linux-gnu/gui/wxpython/core/gcmd.py", line 601, in run
self._redirect_stream()
File "dist.x86_64-pc-linux-gnu/gui/wxpython/core/gcmd.py", line 626, in _redirect_stream
line = recv_some(self.module, e=0, stderr=0)
File "dist.x86_64-pc-linux-gnu/gui/wxpython/core/gcmd.py", line 325, in recv_some
y.append(decode(r))
File "dist.x86_64-pc-linux-gnu/etc/python/grass/script/utils.py", line 201, in decode
return bytes_.decode(enc)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc5 in position 4095: unexpected end of data
Version is a ~week old main branch.
The cause is reading module output in chunks and passing chunks to decode call. This will work fine as long as last byte of chunk is not a part of multibyte character. In such case decoder will throw an error (as in this bug report). The code dealing with module output should be replaced with a stream reader that handles multibyte chars in a proper way.
The text was updated successfully, but these errors were encountered:
While working on a new module I printed a lot of data to stdout. When run from CLI, it was working fine, when run from GUI, it crashes all the time:
Version is a ~week old main branch.
The cause is reading module output in chunks and passing chunks to decode call. This will work fine as long as last byte of chunk is not a part of multibyte character. In such case decoder will throw an error (as in this bug report). The code dealing with module output should be replaced with a stream reader that handles multibyte chars in a proper way.
The text was updated successfully, but these errors were encountered: