I\'m writing a script that logs errors from another program and restarts the program where it left off when it encounters an error. For whatever reasons, the developers of t
You get the ValueError because your code probably has for line in original: in addition to original.readline(). An easy solution which fixes the problem without making your program slower or consume more memory is changing
for line in original:
...
to
while True:
line = original.readline()
if not line: break
...