diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-11 19:49:46 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-02-11 19:49:46 +0100 |
commit | b2903ca6b5ddf65d4e9f390649797546568c0170 (patch) | |
tree | c9c636dfd211f3c18f59a076e2e4cc91b990931d /src/Hooks | |
parent | bdfbf7ea8b427a03dee94cb0f071f66c6fa436f0 (diff) | |
download | abrt-b2903ca6b5ddf65d4e9f390649797546568c0170.tar.gz abrt-b2903ca6b5ddf65d4e9f390649797546568c0170.tar.xz abrt-b2903ca6b5ddf65d4e9f390649797546568c0170.zip |
fix bz#541088 "abrt should not catch python excp EPIPE"
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Hooks')
-rw-r--r-- | src/Hooks/abrt_exception_handler.py.in | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Hooks/abrt_exception_handler.py.in b/src/Hooks/abrt_exception_handler.py.in index 89f30132..b5e15b80 100644 --- a/src/Hooks/abrt_exception_handler.py.in +++ b/src/Hooks/abrt_exception_handler.py.in @@ -59,8 +59,22 @@ def handleMyException((etype, value, tb)): return sys.__excepthook__(etype, value, tb) try: + import os import os.path import traceback + import errno + + # EPIPE is not a crash, it happens all the time + # Testcase: script.py | true, where script.py is: + ## #!/usr/bin/python + ## import os + ## import time + ## time.sleep(1) + ## os.write(1, "Hello\n") # print "Hello" wouldn't be the same + # + if etype == IOError or etype == OSError: + if value.errno == errno.EPIPE: + return sys.__excepthook__(etype, value, tb) # "-c" appears in this case: # $ python -c 'import sys; print "argv0 is:%s" % sys.argv[0]' |