You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ timetra find -a sleep -f 'foooooooooooooooooooooooooooooooooooooooooooo' | head
foooooooooooooooooooooooooooooooooooooooooooo
foooooooooooooooooooooooooooooooooooooooooooo
foooooooooooooooooooooooooooooooooooooooooooo
foooooooooooooooooooooooooooooooooooooooooooo
foooooooooooooooooooooooooooooooooooooooooooo
foooooooooooooooooooooooooooooooooooooooooooo
foooooooooooooooooooooooooooooooooooooooooooo
foooooooooooooooooooooooooooooooooooooooooooo
foooooooooooooooooooooooooooooooooooooooooooo
foooooooooooooooooooooooooooooooooooooooooooo
Traceback (most recent call last):
File "/home/andy/src/timetra/bin/timetra", line 7, in <module>
main()
File "/home/andy/src/timetra/timetra/cli.py", line 172, in main
p.dispatch()
File "/usr/lib/python3.3/site-packages/argh/helpers.py", line 53, in dispatch
return dispatch(self, *args, **kwargs)
File "/usr/lib/python3.3/site-packages/argh/dispatching.py", line 128, in dispatch
io.dump(line, f)
File "/usr/lib/python3.3/site-packages/argh/io.py", line 101, in dump
output_file.write(data)
BrokenPipeError: [Errno 32] Broken pipe
Cause
When a (sufficiently long) line is written to an already closed stream, the BrokenPipeError is raised.
Problem
When the stream is closed, it is probably intentional. In the above case it is head that has closed the stream after getting 10 lines from argh. The exception should not be raised in this situation.
Solution
gather information: what exceptions are raised in this case in which conditions (Python version + stream type)
catch such exception and simply return
The text was updated successfully, but these errors were encountered:
neithere
changed the title
Broken pipe
Broken pipe: recognize "intentionally" closed streams
Jul 5, 2014
Observation
Cause
When a (sufficiently long) line is written to an already closed stream, the BrokenPipeError is raised.
Problem
When the stream is closed, it is probably intentional. In the above case it is
head
that has closed the stream after getting 10 lines fromargh
. The exception should not be raised in this situation.Solution
The text was updated successfully, but these errors were encountered: