You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6b63ca9
Browse filesBrowse the repository at this point in the historyBrowse files
Fix a writer race, the Android shell, code pages, and worker-thread shells
Fixes from another review of the pipeline changes:
- A cmd2 write could hang when a subprocess wrote through the descriptor
relay at the same time. The write fast path checked the consumer's pipe
for room, then wrote without a terminal lend. The relay thread writes
to the same pipe, and could fill it in between. The write then blocked
with no lend, while the pager, waiting for a key, stayed stopped. Once
a relay exists, every write is now made under a lend. Without one,
writes the pipe has room for still need none. DescriptorRelay.idle()
had no other caller, and is gone.
- The start gate ran /bin/sh, which Android does not have, so every
terminal pipe there failed to start. It now uses the POSIX shell that
Popen(shell=True) itself uses: /system/bin/sh on Android.
- On Windows before Python 3.14, a console code page Python has no
cpNNNNN codec for fell back to UTF-8, although Python knows many of
them by other names. Pipes now try those names too: the ISO-8859 family,
KOI8-R and KOI8-U, US-ASCII, GB18030, EUC-JP and EUC-KR. Python 3.14
has a codec for every code page Windows supports.
- A shell command run from a worker thread joined the main thread's
terminal pipeline. Joining relays job-control stops to the main thread,
and may change signal handlers, which only the main thread may do: as a
session leader, it raised ValueError. Only the main thread's shell
commands join now.
Tests cover each, and each fails without its fix: every write is lent
once a relay exists; the gate uses Android's shell; code pages map to
their codecs on any platform; a worker thread's shell command stays out
of the pipeline. The relay tests that used idle() now use flush().
0 commit comments