Diff of the two buildlogs:

--
--- b1/build.log	2025-03-24 08:15:07.736456023 +0000
+++ b2/build.log	2025-03-24 08:20:23.714322967 +0000
@@ -1,6 +1,6 @@
 I: pbuilder: network access will be disabled during build
-I: Current time: Sun Mar 23 20:10:28 -12 2025
-I: pbuilder-time-stamp: 1742803828
+I: Current time: Mon Apr 27 04:38:13 +14 2026
+I: pbuilder-time-stamp: 1777214293
 I: Building the build Environment
 I: extracting base tarball [/var/cache/pbuilder/unstable-reproducible-base.tgz]
 I: copying local configuration
@@ -22,52 +22,84 @@
 dpkg-source: info: unpacking python-sh_2.2.1-1.debian.tar.xz
 I: Not using root during the build.
 I: Installing the build-deps
-I: user script /srv/workspace/pbuilder/1340829/tmp/hooks/D02_print_environment starting
+I: user script /srv/workspace/pbuilder/1902430/tmp/hooks/D01_modify_environment starting
+debug: Running on ionos5-amd64.
+I: Changing host+domainname to test build reproducibility
+I: Adding a custom variable just for the fun of it...
+I: Changing /bin/sh to bash
+'/bin/sh' -> '/bin/bash'
+lrwxrwxrwx 1 root root 9 Apr 26 14:38 /bin/sh -> /bin/bash
+I: Setting pbuilder2's login shell to /bin/bash
+I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other
+I: user script /srv/workspace/pbuilder/1902430/tmp/hooks/D01_modify_environment finished
+I: user script /srv/workspace/pbuilder/1902430/tmp/hooks/D02_print_environment starting
 I: set
-  BUILDDIR='/build/reproducible-path'
-  BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other'
-  BUILDUSERNAME='pbuilder1'
-  BUILD_ARCH='amd64'
-  DEBIAN_FRONTEND='noninteractive'
-  DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=20 '
-  DISTRIBUTION='unstable'
-  HOME='/root'
-  HOST_ARCH='amd64'
+  BASH=/bin/sh
+  BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath
+  BASH_ALIASES=()
+  BASH_ARGC=()
+  BASH_ARGV=()
+  BASH_CMDS=()
+  BASH_LINENO=([0]="12" [1]="0")
+  BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:.
+  BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment")
+  BASH_VERSINFO=([0]="5" [1]="2" [2]="37" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu")
+  BASH_VERSION='5.2.37(1)-release'
+  BUILDDIR=/build/reproducible-path
+  BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other'
+  BUILDUSERNAME=pbuilder2
+  BUILD_ARCH=amd64
+  DEBIAN_FRONTEND=noninteractive
+  DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=42 '
+  DIRSTACK=()
+  DISTRIBUTION=unstable
+  EUID=0
+  FUNCNAME=([0]="Echo" [1]="main")
+  GROUPS=()
+  HOME=/root
+  HOSTNAME=i-capture-the-hostname
+  HOSTTYPE=x86_64
+  HOST_ARCH=amd64
   IFS=' 	
   '
-  INVOCATION_ID='328d605c6326406f864708697348fbc2'
-  LANG='C'
-  LANGUAGE='en_US:en'
-  LC_ALL='C'
-  MAIL='/var/mail/root'
-  OPTIND='1'
-  PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games'
-  PBCURRENTCOMMANDLINEOPERATION='build'
-  PBUILDER_OPERATION='build'
-  PBUILDER_PKGDATADIR='/usr/share/pbuilder'
-  PBUILDER_PKGLIBDIR='/usr/lib/pbuilder'
-  PBUILDER_SYSCONFDIR='/etc'
-  PPID='1340829'
-  PS1='# '
-  PS2='> '
+  INVOCATION_ID=a57d8b135a1e4c62baf88bf4a0e5e112
+  LANG=C
+  LANGUAGE=et_EE:et
+  LC_ALL=C
+  MACHTYPE=x86_64-pc-linux-gnu
+  MAIL=/var/mail/root
+  OPTERR=1
+  OPTIND=1
+  OSTYPE=linux-gnu
+  PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path
+  PBCURRENTCOMMANDLINEOPERATION=build
+  PBUILDER_OPERATION=build
+  PBUILDER_PKGDATADIR=/usr/share/pbuilder
+  PBUILDER_PKGLIBDIR=/usr/lib/pbuilder
+  PBUILDER_SYSCONFDIR=/etc
+  PIPESTATUS=([0]="0")
+  POSIXLY_CORRECT=y
+  PPID=1902430
   PS4='+ '
-  PWD='/'
-  SHELL='/bin/bash'
-  SHLVL='2'
-  SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.vjz4ZYlb/pbuilderrc_1TYo --distribution unstable --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.vjz4ZYlb/b1 --logfile b1/build.log python-sh_2.2.1-1.dsc'
-  SUDO_GID='110'
-  SUDO_UID='105'
-  SUDO_USER='jenkins'
-  TERM='unknown'
-  TZ='/usr/share/zoneinfo/Etc/GMT+12'
-  USER='root'
-  _='/usr/bin/systemd-run'
-  http_proxy='http://46.16.76.132:3128'
+  PWD=/
+  SHELL=/bin/bash
+  SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix
+  SHLVL=3
+  SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.vjz4ZYlb/pbuilderrc_FW1a --distribution unstable --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.vjz4ZYlb/b2 --logfile b2/build.log python-sh_2.2.1-1.dsc'
+  SUDO_GID=110
+  SUDO_UID=105
+  SUDO_USER=jenkins
+  TERM=unknown
+  TZ=/usr/share/zoneinfo/Etc/GMT-14
+  UID=0
+  USER=root
+  _='I: set'
+  http_proxy=http://213.165.73.152:3128
 I: uname -a
-  Linux ionos1-amd64 6.1.0-32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.129-1 (2025-03-06) x86_64 GNU/Linux
+  Linux i-capture-the-hostname 6.12.12+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.12-1~bpo12+1 (2025-02-23) x86_64 GNU/Linux
 I: ls -l /bin
-  lrwxrwxrwx 1 root root 7 Mar  4 11:20 /bin -> usr/bin
-I: user script /srv/workspace/pbuilder/1340829/tmp/hooks/D02_print_environment finished
+  lrwxrwxrwx 1 root root 7 Mar  4  2025 /bin -> usr/bin
+I: user script /srv/workspace/pbuilder/1902430/tmp/hooks/D02_print_environment finished
  -> Attempting to satisfy build-dependencies
  -> Creating pbuilder-satisfydepends-dummy package
 Package: pbuilder-satisfydepends-dummy
@@ -173,7 +205,7 @@
 Get: 56 http://deb.debian.org/debian unstable/main amd64 python3-pluggy all 1.5.0-1 [26.9 kB]
 Get: 57 http://deb.debian.org/debian unstable/main amd64 python3-poetry-core all 2.1.1-3 [228 kB]
 Get: 58 http://deb.debian.org/debian unstable/main amd64 python3-pytest all 8.3.5-1 [250 kB]
-Fetched 28.2 MB in 1s (22.1 MB/s)
+Fetched 28.2 MB in 4s (7819 kB/s)
 Preconfiguring packages ...
 Selecting previously unselected package libpython3.13-minimal:amd64.
 (Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 19807 files and directories currently installed.)
@@ -374,8 +406,8 @@
 Setting up tzdata (2025b-1) ...
 
 Current default time zone: 'Etc/UTC'
-Local time is now:      Mon Mar 24 08:12:29 UTC 2025.
-Universal Time is now:  Mon Mar 24 08:12:29 UTC 2025.
+Local time is now:      Sun Apr 26 14:40:00 UTC 2026.
+Universal Time is now:  Sun Apr 26 14:40:00 UTC 2026.
 Run 'dpkg-reconfigure tzdata' if you wish to change it.
 
 Setting up autotools-dev (20240727.1) ...
@@ -432,7 +464,11 @@
 Building tag database...
  -> Finished parsing the build-deps
 I: Building the package
-I: Running cd /build/reproducible-path/python-sh-2.2.1/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S  > ../python-sh_2.2.1-1_source.changes
+I: user script /srv/workspace/pbuilder/1902430/tmp/hooks/A99_set_merged_usr starting
+Not re-configuring usrmerge for unstable
+I: user script /srv/workspace/pbuilder/1902430/tmp/hooks/A99_set_merged_usr finished
+hostname: Name or service not known
+I: Running cd /build/reproducible-path/python-sh-2.2.1/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S  > ../python-sh_2.2.1-1_source.changes
 dpkg-buildpackage: info: source package python-sh
 dpkg-buildpackage: info: source version 2.2.1-1
 dpkg-buildpackage: info: source distribution unstable
@@ -464,16 +500,93 @@
 collected 181 items / 1 deselected / 180 selected
 
 tests/sh_test.py ....................................................... [ 30%]
-......................s................................................. [ 70%]
-................................s....................                    [100%]
+.............................s.......................................... [ 70%]
+F.................F...................s..............                    [100%]
 
+=================================== FAILURES ===================================
+_____________________ FunctionalTests.test_piped_generator _____________________
+
+self = <tests.sh_test.FunctionalTests testMethod=test_piped_generator>
+
+        def test_piped_generator(self):
+            import time
+    
+            py1 = create_tmp_test(
+                """
+    import sys
+    import os
+    import time
+    
+    for letter in "andrew":
+        time.sleep(0.6)
+        print(letter)
+            """
+            )
+    
+            py2 = create_tmp_test(
+                """
+    import sys
+    import os
+    import time
+    
+    while True:
+        line = sys.stdin.readline()
+        if not line:
+            break
+        print(line.strip().upper())
+            """
+            )
+    
+            times = []
+            last_received = None
+    
+            letters = ""
+            for line in python(
+                "-u", py2.name, _iter=True, _in=python("-u", py1.name, _piped="out")
+            ):
+                letters += line.strip()
+    
+                now = time.time()
+                if last_received:
+                    times.append(now - last_received)
+                last_received = now
+    
+            self.assertEqual("ANDREW", letters)
+>           self.assertTrue(all([t > 0.3 for t in times]))
+E           AssertionError: False is not true
+
+tests/sh_test.py:2010: AssertionError
+__________________ FunctionalTests.test_custom_timeout_signal __________________
+
+self = <tests.sh_test.FunctionalTests testMethod=test_custom_timeout_signal>
+
+        def test_custom_timeout_signal(self):
+            import signal
+    
+            from sh import TimeoutException
+    
+            py = create_tmp_test(
+                """
+    import time
+    time.sleep(3)
+    """
+            )
+            try:
+                python(py.name, _timeout=1, _timeout_signal=signal.SIGHUP)
+            except TimeoutException as e:
+                self.assertEqual(e.exit_code, signal.SIGHUP)
+            else:
+>               self.fail("we should have handled a TimeoutException")
+E               AssertionError: we should have handled a TimeoutException
+
+tests/sh_test.py:2972: AssertionError
 =============================== warnings summary ===============================
-tests/sh_test.py: 138 warnings
-  /build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py:1983: DeprecationWarning: This process (pid=1381522) is multi-threaded, use of fork() may lead to deadlocks in the child.
+tests/sh_test.py: 101 warnings
+  /build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py:1983: DeprecationWarning: This process (pid=1914087) is multi-threaded, use of fork() may lead to deadlocks in the child.
     self.pid = os.fork()
 
-tests/sh_test.py::FunctionalTests::test_stdout_callback_kill
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1382677
+tests/sh_test.py::FunctionalTests::test_unchecked_pipeline_failure
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1914528
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -493,9 +606,9 @@
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
     File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 823, in handle_command_exit_code
       raise exc
-  sh.SignalException_SIGKILL: 
+  sh.ErrorReturnCode_2: 
   
-    RAN: /usr/bin/python3.13 -u /tmp/tmpx35lzizv
+    RAN: /usr/bin/python3.13 /tmp/tmpoo5v2x3f
   
     STDOUT:
   
@@ -505,8 +618,35 @@
   
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
-tests/sh_test.py::FunctionalTests::test_signal_group
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1384485
+tests/sh_test.py::FunctionalTests::test_fg_alternative
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread STDIN thread for pid 1914885
+  
+  Traceback (most recent call last):
+    File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
+      self.run()
+      ~~~~~~~~^^
+    File "/usr/lib/python3.13/threading.py", line 992, in run
+      self._target(*self._args, **self._kwargs)
+      ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+    File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 1642, in wrap
+      fn(*rgs, **kwargs)
+      ~~^^^^^^^^^^^^^^^^
+    File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 2594, in input_thread
+      done = stdin.write()
+    File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 2907, in write
+      chunk = self.get_chunk()
+    File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 2848, in fn
+      chunk = stdin.read(bufsize)
+    File "/usr/lib/python3/dist-packages/_pytest/capture.py", line 227, in read
+      raise OSError(
+          "pytest: reading from stdin while output is captured!  Consider using `-s`."
+      )
+  OSError: pytest: reading from stdin while output is captured!  Consider using `-s`.
+  
+    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
+
+tests/sh_test.py::FunctionalTests::test_piped_exception2
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1914921
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -526,13 +666,11 @@
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
     File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 823, in handle_command_exit_code
       raise exc
-  sh.SignalException_SIGKILL: 
+  sh.ErrorReturnCode_2: 
   
-    RAN: /usr/bin/python3.13 /tmp/tmppm4lje5f
+    RAN: /usr/bin/python3.13 /tmp/tmpe8jebju3
   
     STDOUT:
-  1384538
-  1384485
   
   
     STDERR:
@@ -540,8 +678,8 @@
   
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
-tests/sh_test.py::FunctionalTests::test_timeout_wait_negative
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1384563
+tests/sh_test.py::FunctionalTests::test_signal_group
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1915122
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -563,11 +701,11 @@
       raise exc
   sh.SignalException_SIGKILL: 
   
-    RAN: /usr/bin/python3.13 /tmp/tmppm4lje5f
+    RAN: /usr/bin/python3.13 /tmp/tmpdsqyxgze
   
     STDOUT:
-  1384616
-  1384563
+  1915188
+  1915122
   
   
     STDERR:
@@ -575,8 +713,8 @@
   
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
-tests/sh_test.py::FunctionalTests::test_signal_exception
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1385854
+tests/sh_test.py::FunctionalTests::test_exception
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1915207
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -596,11 +734,13 @@
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
     File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 823, in handle_command_exit_code
       raise exc
-  sh.SignalException_SIGTERM: 
+  sh.SignalException_SIGKILL: 
   
-    RAN: /usr/bin/python3.13 /tmp/tmp4e60sghy
+    RAN: /usr/bin/python3.13 /tmp/tmpdsqyxgze
   
     STDOUT:
+  1915213
+  1915207
   
   
     STDERR:
@@ -608,8 +748,8 @@
   
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
-tests/sh_test.py::FunctionalTests::test_stdout_callback_terminate
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1385874
+tests/sh_test.py::FunctionalTests::test_done_cb_exc
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1915337
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -629,9 +769,9 @@
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
     File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 823, in handle_command_exit_code
       raise exc
-  sh.SignalException_SIGTERM: 
+  sh.ErrorReturnCode_1: 
   
-    RAN: /usr/bin/python3.13 -u /tmp/tmpg6u6c89i
+    RAN: /usr/bin/python3.13 /tmp/tmp27r1gtzr
   
     STDOUT:
   
@@ -641,12 +781,8 @@
   
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
-tests/sh_test.py::FunctionalTests::test_fg
-tests/sh_test.py::FunctionalTests::test_fg_env
-  <frozen os>:890: DeprecationWarning: This process (pid=1381522) is multi-threaded, use of fork() may lead to deadlocks in the child.
-
-tests/sh_test.py::FunctionalTests::test_done_cb_exc
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1386935
+tests/sh_test.py::FunctionalTests::test_stdout_callback_kill
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1915545
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -666,9 +802,9 @@
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
     File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 823, in handle_command_exit_code
       raise exc
-  sh.ErrorReturnCode_1: 
+  sh.SignalException_SIGKILL: 
   
-    RAN: /usr/bin/python3.13 /tmp/tmp3flc7nq_
+    RAN: /usr/bin/python3.13 -u /tmp/tmpkc1g1533
   
     STDOUT:
   
@@ -678,8 +814,11 @@
   
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
-tests/sh_test.py::FunctionalTests::test_unchecked_producer_failure
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1389836
+tests/sh_test.py::FunctionalTests::test_fg
+  <frozen os>:890: DeprecationWarning: This process (pid=1914087) is multi-threaded, use of fork() may lead to deadlocks in the child.
+
+tests/sh_test.py::FunctionalTests::test_signal_exception
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1915796
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -699,9 +838,9 @@
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
     File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 823, in handle_command_exit_code
       raise exc
-  sh.ErrorReturnCode_2: 
+  sh.SignalException_SIGTERM: 
   
-    RAN: /usr/bin/python3.13 /tmp/tmpg4ht5c0z
+    RAN: /usr/bin/python3.13 /tmp/tmpk4jil96x
   
     STDOUT:
   
@@ -712,7 +851,7 @@
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
 tests/sh_test.py::FunctionalTests::test_piped_exception1
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1390819
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1916050
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -734,7 +873,7 @@
       raise exc
   sh.ErrorReturnCode_2: 
   
-    RAN: /usr/bin/python3.13 /tmp/tmp2x_nl8jq
+    RAN: /usr/bin/python3.13 /tmp/tmp26cd5rrh
   
     STDOUT:
   
@@ -744,35 +883,8 @@
   
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
-tests/sh_test.py::FunctionalTests::test_fg_alternative
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread STDIN thread for pid 1391909
-  
-  Traceback (most recent call last):
-    File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
-      self.run()
-      ~~~~~~~~^^
-    File "/usr/lib/python3.13/threading.py", line 992, in run
-      self._target(*self._args, **self._kwargs)
-      ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-    File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 1642, in wrap
-      fn(*rgs, **kwargs)
-      ~~^^^^^^^^^^^^^^^^
-    File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 2594, in input_thread
-      done = stdin.write()
-    File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 2907, in write
-      chunk = self.get_chunk()
-    File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 2848, in fn
-      chunk = stdin.read(bufsize)
-    File "/usr/lib/python3/dist-packages/_pytest/capture.py", line 227, in read
-      raise OSError(
-          "pytest: reading from stdin while output is captured!  Consider using `-s`."
-      )
-  OSError: pytest: reading from stdin while output is captured!  Consider using `-s`.
-  
-    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
-
-tests/sh_test.py::FunctionalTests::test_unchecked_pipeline_failure
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1392385
+tests/sh_test.py::FunctionalTests::test_stdout_callback_terminate
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1916168
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -792,9 +904,9 @@
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
     File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 823, in handle_command_exit_code
       raise exc
-  sh.ErrorReturnCode_2: 
+  sh.SignalException_SIGTERM: 
   
-    RAN: /usr/bin/python3.13 /tmp/tmprps7n4le
+    RAN: /usr/bin/python3.13 -u /tmp/tmpyxnh8kaq
   
     STDOUT:
   
@@ -804,8 +916,8 @@
   
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
-tests/sh_test.py::FunctionalTests::test_piped_exception2
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1392426
+tests/sh_test.py::FunctionalTests::test_exit_code_with_hasattr
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1916617
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -825,9 +937,9 @@
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
     File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 823, in handle_command_exit_code
       raise exc
-  sh.ErrorReturnCode_2: 
+  sh.ErrorReturnCode_3: 
   
-    RAN: /usr/bin/python3.13 /tmp/tmpw5__23yn
+    RAN: /usr/bin/python3.13 /tmp/tmpay38bs7g
   
     STDOUT:
   
@@ -837,8 +949,8 @@
   
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
-tests/sh_test.py::FunctionalTests::test_exit_code_with_hasattr
-  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1393409
+tests/sh_test.py::FunctionalTests::test_unchecked_producer_failure
+  /usr/lib/python3/dist-packages/_pytest/threadexception.py:82: PytestUnhandledThreadExceptionWarning: Exception in thread background thread for pid 1916753
   
   Traceback (most recent call last):
     File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
@@ -858,9 +970,9 @@
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
     File "/build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build/sh.py", line 823, in handle_command_exit_code
       raise exc
-  sh.ErrorReturnCode_3: 
+  sh.ErrorReturnCode_2: 
   
-    RAN: /usr/bin/python3.13 /tmp/tmph843sltj
+    RAN: /usr/bin/python3.13 /tmp/tmplt17au6_
   
     STDOUT:
   
@@ -871,40 +983,26 @@
     warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
 
 -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
-==== 178 passed, 2 skipped, 1 deselected, 152 warnings in 90.35s (0:01:30) =====
-   create-stamp debian/debhelper-build-stamp
-   dh_testroot -O--buildsystem=pybuild
-   dh_prep -O--buildsystem=pybuild
-   dh_auto_install --destdir=debian/python3-sh/ -O--buildsystem=pybuild
-I: pybuild plugin_pyproject:178: Copying package built for python3.13 to destdir
-   dh_installdocs -O--buildsystem=pybuild
-   dh_installchangelogs -O--buildsystem=pybuild
-   dh_python3 -O--buildsystem=pybuild
-   dh_installsystemduser -O--buildsystem=pybuild
-   dh_perl -O--buildsystem=pybuild
-   dh_link -O--buildsystem=pybuild
-   dh_strip_nondeterminism -O--buildsystem=pybuild
-   dh_compress -O--buildsystem=pybuild
-   dh_fixperms -O--buildsystem=pybuild
-   dh_missing -O--buildsystem=pybuild
-   dh_installdeb -O--buildsystem=pybuild
-   dh_gencontrol -O--buildsystem=pybuild
-   dh_md5sums -O--buildsystem=pybuild
-   dh_builddeb -O--buildsystem=pybuild
-dpkg-deb: building package 'python3-sh' in '../python3-sh_2.2.1-1_all.deb'.
- dpkg-genbuildinfo --build=binary -O../python-sh_2.2.1-1_amd64.buildinfo
- dpkg-genchanges --build=binary -O../python-sh_2.2.1-1_amd64.changes
-dpkg-genchanges: info: binary-only upload (no source code included)
- dpkg-source --after-build .
-dpkg-buildpackage: info: binary-only upload (no source included)
-dpkg-genchanges: info: including full source code in upload
+=========================== short test summary info ============================
+FAILED tests/sh_test.py::FunctionalTests::test_piped_generator - AssertionErr...
+FAILED tests/sh_test.py::FunctionalTests::test_custom_timeout_signal - Assert...
+= 2 failed, 176 passed, 2 skipped, 1 deselected, 114 warnings in 117.96s (0:01:57) =
+E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd /build/reproducible-path/python-sh-2.2.1/.pybuild/cpython3_3.13_sh/build; python3.13 -m pytest tests/sh_test.py -k 'not test_environment'
+dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p 3.13 returned exit code 13
+make: *** [debian/rules:7: binary] Error 25
+dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
 I: copying local configuration
+E: Failed autobuilding of package
+I: user script /srv/workspace/pbuilder/1902430/tmp/hooks/C01_cleanup starting
+debug output: disk usage on i-capture-the-hostname at Sun Apr 26 14:43:16 UTC 2026
+Filesystem      Size  Used Avail Use% Mounted on
+tmpfs            40G     0   40G   0% /dev/shm
+
+I: user script /srv/workspace/pbuilder/1902430/tmp/hooks/C01_cleanup finished
 I: unmounting dev/ptmx filesystem
 I: unmounting dev/pts filesystem
 I: unmounting dev/shm filesystem
 I: unmounting proc filesystem
 I: unmounting sys filesystem
 I: cleaning the build env 
-I: removing directory /srv/workspace/pbuilder/1340829 and its subdirectories
-I: Current time: Sun Mar 23 20:15:06 -12 2025
-I: pbuilder-time-stamp: 1742804106
+I: removing directory /srv/workspace/pbuilder/1902430 and its subdirectories