Skip to content

gh-159394: Fix test_curses when $LINES or $COLUMNS is set - #159665

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:gh-159394-newterm-size
Oct 18, 2026
Merged

serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:gh-159394-newterm-size

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

A new pseudo-terminal has no size, so newterm() takes the size of the screen from the LINES and COLUMNS environment variables, and from the terminfo entry only if they are unset. test_newterm and SLKTests.test_init_reserves_a_line failed when either variable was set. The newterm tests now set both, so the screen is always 24x80.

Also add a test for LINES and COLUMNS themselves.

🤖 Generated with Claude Code

The newterm() tests now set the size of the screen explicitly, instead of
depending on the environment.  Add a test for $LINES and $COLUMNS.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…term-size

# Conflicts:
#	Lib/test/test_curses.py
@mgorny

mgorny commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Seems to fix it for me.

@serhiy-storchaka
serhiy-storchaka merged commit 0f2eb5a into python:main Oct 18, 2026
50 checks passed
@serhiy-storchaka
serhiy-storchaka deleted the gh-159394-newterm-size branch October 18, 2026 15:51
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 Windows PGO NoGIL 3.x (tier-1) has failed when building commit 0f2eb5a.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1622/builds/5912) and take a look at the build logs.
  4. Check if the failure is related to this commit (0f2eb5a) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1622/builds/5912

Failed tests:

  • test.test_multiprocessing_spawn.test_processes

Failed subtests:

  • test_async_error_callback - test.test_multiprocessing_spawn.test_processes.WithProcessesTestPoolWorkerErrors.test_async_error_callback

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "C:\bbarea\3.x.itamaro-win64-srv-22-aws.nogil.pgo\build\Lib\contextlib.py", line 116, in inner
    return func(*args, **kwds)
  File "C:\bbarea\3.x.itamaro-win64-srv-22-aws.nogil.pgo\build\Lib\test\_test_multiprocessing.py", line 3603, in test_async_error_callback
    p.close()
    ~~~~~~~^^
  File "C:\bbarea\3.x.itamaro-win64-srv-22-aws.nogil.pgo\build\Lib\multiprocessing\pool.py", line 668, in close
    self._change_notifier.put(None)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "C:\bbarea\3.x.itamaro-win64-srv-22-aws.nogil.pgo\build\Lib\multiprocessing\queues.py", line 394, in put
    self._writer.send_bytes(obj)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "C:\bbarea\3.x.itamaro-win64-srv-22-aws.nogil.pgo\build\Lib\multiprocessing\connection.py", line 210, in send_bytes
    self._send_bytes(m[offset:offset + size])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\bbarea\3.x.itamaro-win64-srv-22-aws.nogil.pgo\build\Lib\multiprocessing\connection.py", line 297, in _send_bytes
    raise ValueError("concurrent send_bytes() calls "
                     "are not supported")
ValueError: concurrent send_bytes() calls are not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants