[PATCH 1/1] wvtest-bash.sh: handle signal.SIGPIPE printing across py versions

0 views
Skip to first unread message

Rob Browning

unread,
Aug 18, 2025, 3:45:01 PMAug 18
to bup-...@googlegroups.com
signal.SIGPIPE comes from an IntEnum and looks like python changed the
print (str) behavior in 3.11:

https://docs.python.org/3/library/enum.html#enum.IntEnum

Older python versions print Signals.SIGPIPE instead of the value.

Explicitly request the value to avoid the problem, and also add a
missing exit status check so that we fail immediately if the
arithmetic expression is invalid.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---

Pushed to main.

wvtest-bash.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wvtest-bash.sh b/wvtest-bash.sh
index 1274cd43..9d5803b7 100644
--- a/wvtest-bash.sh
+++ b/wvtest-bash.sh
@@ -32,9 +32,9 @@ _wvfind_caller()
}


-_wvsigpipe_rc="$(dev/python -c 'import signal; print(signal.SIGPIPE)')" \
+_wvsigpipe_rc="$(dev/python -c 'import signal; print(signal.SIGPIPE.value)')" \
|| exit $?
-_wvsigpipe_rc="$((_wvsigpipe_rc + 128))"
+_wvsigpipe_rc="$((_wvsigpipe_rc + 128))" || exit $?

WVPIPE()
{
--
2.47.2

Reply all
Reply to author
Forward
0 new messages