Operate on a byte level instead of utf8 strings only
This commit is contained in:
@ -17,13 +17,13 @@ class PipeWriterThread(Thread):
|
||||
@terminate_process_on_failure
|
||||
def run(self):
|
||||
try:
|
||||
with open(self._pipe_path, 'w') as pipe:
|
||||
with open(self._pipe_path, 'wb') as pipe:
|
||||
while True:
|
||||
message = self._write_queue.get(block=True)
|
||||
if message is None:
|
||||
self._stop_event.set()
|
||||
break
|
||||
pipe.write(f'{message}\n')
|
||||
pipe.write(message + b'\n')
|
||||
pipe.flush()
|
||||
except BrokenPipeError:
|
||||
self._stop_event.set()
|
||||
@ -34,4 +34,4 @@ class PipeWriterThread(Thread):
|
||||
|
||||
def unblock(self):
|
||||
self._write_queue.put(None)
|
||||
open(self._pipe_path, 'r').close()
|
||||
open(self._pipe_path, 'rb').close()
|
||||
|
Reference in New Issue
Block a user