Skip to content

Commit

Permalink
Fix SIGPIPE bug that broke CLI on non-unix systems
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjake committed Nov 8, 2024
1 parent ebbfce6 commit b59c99e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
Release History
---------------

5.0.1 (?)
+++++++++

**Bugfixes**

- Fix bug where the use of signal.SIGPIPE causes the CLI to crash on Windows (SIGPIPE is not available on Windows).

5.0.0 (2024-11-07)
++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion internetarchive/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '5.0.0'
__version__ = '5.0.1.dev'
8 changes: 6 additions & 2 deletions internetarchive/cli/ia.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@
from internetarchive.cli.cli_utils import exit_on_signal

# Handle <Ctrl-C> and broken pipe
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
signal.signal(signal.SIGINT, exit_on_signal)
try:
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
signal.signal(signal.SIGINT, exit_on_signal)
except AttributeError:
# Non-unix support
pass


def validate_config_path(path):
Expand Down

0 comments on commit b59c99e

Please sign in to comment.