mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-06-25 03:38:59 +02:00
Solved EOL bug
This commit is contained in:
parent
7dd8fd4a5f
commit
0114b30824
5
main.py
5
main.py
@ -162,12 +162,17 @@ if __name__ == "__main__":
|
|||||||
text=True
|
text=True
|
||||||
)
|
)
|
||||||
os.close(slave_fd)
|
os.close(slave_fd)
|
||||||
|
import errno
|
||||||
with os.fdopen(master_fd) as master:
|
with os.fdopen(master_fd) as master:
|
||||||
|
try:
|
||||||
for line in master:
|
for line in master:
|
||||||
ts = datetime.now().strftime('%Y-%m-%dT%H:%M:%S')
|
ts = datetime.now().strftime('%Y-%m-%dT%H:%M:%S')
|
||||||
log_file.write(f"{ts} {line}")
|
log_file.write(f"{ts} {line}")
|
||||||
log_file.flush()
|
log_file.flush()
|
||||||
print(line, end='')
|
print(line, end='')
|
||||||
|
except OSError as e:
|
||||||
|
if e.errno != errno.EIO:
|
||||||
|
raise
|
||||||
proc.wait()
|
proc.wait()
|
||||||
rc = proc.returncode
|
rc = proc.returncode
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user