Skip to content

Commit

Permalink
Sigpipe (#123)
Browse files Browse the repository at this point in the history
* Do not trap SIGPIPE anymore
  • Loading branch information
andamian committed Apr 30, 2019
1 parent f3a5337 commit 996e47d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vos/setup.cfg
Expand Up @@ -51,7 +51,7 @@ edit_on_github = False
github_project = opencadc/vostools
install_requires = html2text>=2016.5.29 cadcutils>=1.1.20 future enum34
# version should be PEP440 compatible (http://www.python.org/dev/peps/pep-0440)
version = 3.0.11.1
version = 3.0.12

[entry_points]
vcat = vos.commands.vcat:vcat
Expand Down
4 changes: 3 additions & 1 deletion vos/vos/commonparser.py
Expand Up @@ -12,11 +12,13 @@

def signal_handler(signum, frame):
"""Exit without calling cleanup handlers, flushing stdio buffers, etc. """
logging.info('Received signal {}. Exiting.'.format(signum))
os._exit(signum)


signal.signal(signal.SIGINT, signal_handler) # Ctrl-C
signal.signal(signal.SIGPIPE, signal_handler) # Pipe gone (head, more etc)
# Disabled due to unexpected SIGPIPE signals that do not warn the user
# signal.signal(signal.SIGPIPE, signal_handler) # Pipe gone (head, more etc)


def exit_on_exception(ex, message=None):
Expand Down

0 comments on commit 996e47d

Please sign in to comment.