mirror of
https://github.com/clearml/clearml-agent
synced 2025-02-24 21:24:36 +00:00
Add protection for truncate() call
This commit is contained in:
parent
05a65548da
commit
6fbd70786e
@ -1883,8 +1883,13 @@ class Worker(ServiceCommandSection):
|
|||||||
pos = f.tell()
|
pos = f.tell()
|
||||||
else:
|
else:
|
||||||
# buffered - read everything and truncate
|
# buffered - read everything and truncate
|
||||||
|
# noinspection PyBroadException
|
||||||
|
try:
|
||||||
f.truncate(0)
|
f.truncate(0)
|
||||||
pos = 0
|
pos = 0
|
||||||
|
except Exception:
|
||||||
|
pos = f.tell()
|
||||||
|
|
||||||
# skip the previously printed lines,
|
# skip the previously printed lines,
|
||||||
blines = binary_text.split(b'\n') if binary_text else []
|
blines = binary_text.split(b'\n') if binary_text else []
|
||||||
if not blines:
|
if not blines:
|
||||||
|
Loading…
Reference in New Issue
Block a user