Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
Description
Bug report
Bug description:
While working on packaging Python 3.12 for OpenIndiana I noticed failures in Lib/test/test_termios.py, which boil down to a comical "you go first" / "no, I insist, you go first" standoff between Modules/termios.c and the illumos kernel's pty code.
illumos will not return success fromTIOCGWINSZ
unless a priorTIOCSWINSZ
has set at least one of the four dimensions to a non-zero value, while a freshly created pty has all four set to zero. Seehttps://github.com/illumos/illumos-gate/blame/0c4d3ec56b3e8f2f8bcc4dbe1eb32871e2663b39/usr/src/uts/common/io/ptem.c#L936-L943
Meanwhile, Python refuses to callTIOCSWINSZ
to set the window size unless a prior call toTIOCGWINSZ
succeeds, lest it clobber the rarely-usedws_xpixel
andws_ypixel
fields.
As a result, all of the termios window size tests fail even though the interface is fully functional on a pty that someone else initialized with a window size.
In my draft patch for this atBill-Sommerfeld/oi-userland@fd47054
I have Python break the impasse - ifTIOCGWINSZ
fails intermios_tcgetwinsize_impl
, just zero out ourstruct winsize w
and drive on to try to set the size with the caller-provided rows and columns values.
The patch also fixes the test to set a non-zero window size on the pty allocated by the test iftermios.tcgetwinsize
fails in the setup code.
I'll be happy to convert this patch to a pull request on some branch of the python repo if that would be appropriate.
CPython versions tested on:
3.12
Operating systems tested on:
Other