Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

3.12.2: termios: fetching window size may not work until you set it. #115189

Closed
Labels
extension-modulesC modules in the Modules dirpendingThe issue will be closed if no feedback is providedtype-bugAn unexpected behavior, bug, or error
@Bill-Sommerfeld

Description

@Bill-Sommerfeld

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirpendingThe issue will be closed if no feedback is providedtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp