mirror of
https://github.com/clearml/clearml-agent
synced 2025-02-24 13:23:29 +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()
|
||||
else:
|
||||
# buffered - read everything and truncate
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
f.truncate(0)
|
||||
pos = 0
|
||||
except Exception:
|
||||
pos = f.tell()
|
||||
|
||||
# skip the previously printed lines,
|
||||
blines = binary_text.split(b'\n') if binary_text else []
|
||||
if not blines:
|
||||
|
Loading…
Reference in New Issue
Block a user