kenfar/DataGristle — Issue #12: Improve pipe handling
Author: kenfar
Created: 2012-01-05 05:24:29+00:00
State: open
Labels: Defect, Medium Priority

Received this error:

-------------------------------------------------------------------------------------------------------------------------------------------------------------
kenfar@glenda:~/projects/datagristle/scripts$ ./gristle_slicer.py ../../data_general/2012* -c 0:10 -r 0:50 | ./gristle_viewer.py -r 33
missing delimiter - will abort
Usage: The gristle_viewer.py is used to view data one record at a time.
gristle_viewer.py [file] -q -v -h --delimiter [value] --recnum [value]

gristle_viewer.py: error: Please provide delimiter when piping data into program via stdin or reading multiple input files
close failed in file object destructor:
Error in sys.excepthook:

Original exception was:

-------------------------------------------------------------------------------------------------------------------------------------------------------------

References to this error:
http://stackoverflow.com/questions/180095/how-to-handle-a-broken-pipe-sigpipe-in-python
http://stackoverflow.com/questions/6537178/python-how-to-catch-a-broken-pipe

-------------------------------------------------------------------------------------------------------------------------------------------------------------

This appears to be a problem with the second program closing while the first is still sending data. A try/except block in the first didn't catch the error. Not sure what to do here.