mirror of
https://github.com/optim-enterprises-bv/Mailu.git
synced 2025-10-29 17:22:20 +00:00
Untested code that may fix the following:
Exception in thread Thread-2 (forward_text_lines):
Traceback (most recent call last):
File "/usr/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
self.run() File "/usr/lib/python3.12/threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "/app/venv/lib/python3.12/site-packages/socrate/system.py", line 155, in forward_text_lines
current_line = src.readline()
^^^^^^^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa8 in position 166: invalid start byte
This was reported in #3398
This commit is contained in:
@@ -158,7 +158,7 @@ def forward_text_lines(src, dst):
|
||||
|
||||
# runs a process and passes its standard/error output to the standard/error output of the current python script
|
||||
def run_process_and_forward_output(cmd):
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
||||
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding='utf-8')
|
||||
|
||||
stdout_thread = threading.Thread(target=forward_text_lines, args=(process.stdout, sys.stdout))
|
||||
stdout_thread.daemon = True
|
||||
|
||||
Reference in New Issue
Block a user