Changed flush() method to child fd

This commit is contained in:
Anton Hvornum 2022-02-09 15:33:09 +01:00
parent c3caea51cc
commit e2f42065d7
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
1 changed files with 2 additions and 1 deletions

View File

@ -288,7 +288,8 @@ class SysCommandWorker:
if self.child_fd:
written_data = os.write(self.child_fd, data + (b'\n' if line_ending else b''))
os.fsync(self.child_fd)
sys.stdout.flush()
# os.fsync(self.child_fd) # <-- Will generate OSError: [Error 22] Invalid argument
written_data_string = data + (b'\n' if line_ending else b'')
silent_output.write(f"Wrote {[written_data_string]}\n")