Skip to content

Commit

Permalink
Merge pull request #659 from jjjake/windows-sigpipe-fix
Browse files Browse the repository at this point in the history
Fix SIGPIPE bug that broke CLI on non-unix systems
  • Loading branch information
jjjake authored Nov 8, 2024
2 parents ebbfce6 + 109c996 commit 201369a
Show file tree
Hide file tree
Showing 3 changed files with 16 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'
10 changes: 8 additions & 2 deletions internetarchive/cli/ia.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@
)
from internetarchive.cli.cli_utils import exit_on_signal

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

# Handle <Ctrl-C>
signal.signal(signal.SIGINT, exit_on_signal)


Expand Down

0 comments on commit 201369a

Please sign in to comment.