Skip to content

gh-140482: Avoid changing terminal settings in test_pty - #142202

Merged
colesbury merged 3 commits into
python:mainfrom
colesbury:gh-140482-pty
Dec 3, 2025
Merged

gh-140482: Avoid changing terminal settings in test_pty#142202
colesbury merged 3 commits into
python:mainfrom
colesbury:gh-140482-pty

Conversation

@colesbury

@colesburycolesbury commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

The previous test_spawn_doesnt_hang test had a few problems:

  • It would cause ENV CHANGED failures if other tests were running concurrently due to stty changes
  • Typing while the test was running could cause it to fail

The previous test_spawn_doesnt_hang test had a few problems:
* It would cause ENV CHANGED failures if other tests were running
concurrently due to stty changes
* Typing while the test was running could cause it to fail
@bedevere-appbedevere-appBot added the tests Tests in the Lib/test dir label Dec 2, 2025
@colesburycolesbury added 🔨 test-with-buildbots Test PR w/ buildbots; report in status section and removed tests Tests in the Lib/test dir labels Dec 2, 2025
@bedevere-bot

This comment was marked as outdated.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 2, 2025
@colesburycolesbury added tests Tests in the Lib/test dir skip news labels Dec 2, 2025
@colesburycolesbury added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 2, 2025
@bedevere-bot

This comment was marked as outdated.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 2, 2025
@colesburycolesbury added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 3, 2025
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @colesbury for commit d89f1b7 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F142202%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Dec 3, 2025
@colesbury
colesbury marked this pull request as ready for review December 3, 2025 04:56

@warsawwarsaw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran this branch many times with both make test and make quicktest on macOS 26.1 and could never trigger the env changed warnings. The changes here seem correct, so I'll approve it, although I notice that CI is failing.

@colesbury

Copy link
Copy Markdown
ContributorAuthor

although I notice that CI is failing

The Android (x86_64) failures is unrelated and failing on other PRs

@colesbury
colesbury merged commit c0c6514 into python:mainDec 3, 2025
228 of 234 checks passed
@colesbury
colesbury deleted the gh-140482-pty branch December 3, 2025 20:48
@colesburycolesbury added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Dec 3, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 3, 2025
…gh-142202)
The previous test_spawn_doesnt_hang test had a few problems:
* It would cause ENV CHANGED failures if other tests were running
concurrently due to stty changes
* Typing while the test was running could cause it to fail
(cherry picked from commit c0c6514)
Co-authored-by: Sam Gross <colesbury@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 3, 2025
…gh-142202)
The previous test_spawn_doesnt_hang test had a few problems:
* It would cause ENV CHANGED failures if other tests were running
concurrently due to stty changes
* Typing while the test was running could cause it to fail
(cherry picked from commit c0c6514)
Co-authored-by: Sam Gross <colesbury@gmail.com>
@bedevere-app

Copy link
Copy Markdown

GH-142238 is a backport of this pull request to the 3.13 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.13 bugs and security fixes label Dec 3, 2025
@bedevere-app

Copy link
Copy Markdown

GH-142239 is a backport of this pull request to the 3.14 branch.

@bedevere-appbedevere-appBot removed the needs backport to 3.14 bugs and security fixes label Dec 3, 2025
@bedevere-bot

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 Debian root 3.x (tier-1) has failed when building commit c0c6514.

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/345/builds/12810) and take a look at the build logs.
  4. Check if the failure is related to this commit (c0c6514) 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/345/builds/12810

Failed tests:

  • test_http_cookies
  • test_ctypes
  • test_tokenize
  • test_tools
  • test_pickle

Failed subtests:

  • test_framing_many_objects - test.test_pickle.CPicklerTests.test_framing_many_objects
  • test_random_files - test.test_tokenize.TestRoundtrip.test_random_files
  • test_unquote_large - test.test_http_cookies.CookieTests.test_unquote_large
  • test_freeze_simple_script - test.test_tools.test_freeze.TestFreeze.test_freeze_simple_script

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

==

Click to see traceback logs
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_tokenize.py", line 2190, in test_random_filesself.check_roundtrip(f)
~~~~~~~~~~~~~~~~~~~~^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_tokenize.py", line 2027, in check_roundtrip
tokens2_from5 = [tok[:2] for tok in tokenize.tokenize(readline5)]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/tokenize.py", line 498, in tokenizeyield from _generate_tokens_from_c_tokenizer(rl_gen.__next__, encoding, extra_tokens=True)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/tokenize.py", line 589, in _generate_tokens_from_c_tokenizeryield TokenInfo._make(info)
~~~~~~~~~~~~~~~^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/collections/__init__.py", line 456, in _makeif _len(result) != num_fields:
~~~~^^^^^^^^TypeError: object of type 'type' has no len()
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Tools/freeze/freeze.py", line 494, in <module>
main()
~~~~^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Tools/freeze/freeze.py", line 392, in main
files = makefreeze.makefreeze(base, dict, debug, custom_entry_point,
fail_import)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Tools/freeze/makefreeze.py", line 52, in makefreeze
writecode(outfp, mangled, str)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Tools/freeze/makefreeze.py", line 83, in writecodeprint('%d,'% c, file=fp, end='')
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError: 'int' object has no attribute 'write'
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_tools/test_freeze.py", line 35, in test_freeze_simple_script
executable = helper.freeze(python, scriptfile, outdir)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Tools/freeze/test/freeze.py", line 169, in freeze
_run_quiet([python, '-E', FREEZE, '-o', outdir, scriptfile], cwd=outdir)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Tools/freeze/test/freeze.py", line 35, in _run_quietreturn subprocess.run(
~~~~~~~~~~~~~~^
cmd,
^^^^...<3 lines>...
check=True,
^^^^^^^^^^^
)
^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/subprocess.py", line 576, in runraise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/tmp/test_python_ptogmdlk/tmpyts3ic1l/python-installation/bin/python3', '-E', '/root/buildarea/3.x.angelico-debian-amd64/build/Tools/freeze/freeze.py', '-o', '/tmp/test_python_ptogmdlk/tmpyts3ic1l', '/tmp/test_python_ptogmdlk/tmpyts3ic1l/app.py']' returned non-zero exit status 1.
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_tokenize.py", line 2190, in test_random_filesself.check_roundtrip(f)
~~~~~~~~~~~~~~~~~~~~^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_tokenize.py", line 2034, in check_roundtrip
untokenized_code = tokenize.untokenize(tokenize.tokenize(readline))
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/tokenize.py", line 341, in untokenize
out = ut.untokenize(iterable)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/tokenize.py", line 262, in untokenizeself.add_whitespace(start)
~~~~~~~~~~~~~~~~~~~^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/tokenize.py", line 180, in add_whitespaceself.add_backslash_continuation(start)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^TypeError: 'Untokenizer' object is not callable
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/pickletester.py", line 3633, in test_framing_many_objectsself.check_frame_opcodes(pickled)
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/pickletester.py", line 3582, in check_frame_opcodesfor op, arg, pos in pickletools.genops(pickled):
~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/pickletools.py", line 2285, in _genopsraiseValueError("at position %s, opcode %r unknown"% (
"<unknown>"if pos isNoneelse pos,
code))
ValueError: at position 188258, opcode b'M' unknown
Traceback (most recent call last):
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_http_cookies.py", line 162, in test_unquote_large
C.load(data)
~~~~~~^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/http/cookies.py", line 518, in loadself.__parse_string(rawdata)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/http/cookies.py", line 567, in __parse_string
parsed_items.append((TYPE_KEYVALUE, key, self.value_decode(value)))
~~~~~~~~~~~~~~~~~^^^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/http/cookies.py", line 594, in value_decodereturn _unquote(val), val
~~~~~~~~^^^^^
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/http/cookies.py", line 213, in _unquotereturn _unquote_sub(_unquote_replace, str)
File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/http/cookies.py", line 190, in _unquote_replaceif m[1]:
~^^^TypeError: unsupported operand type(s) for +: 're.Match' and 'int'

colesbury added a commit that referenced this pull request Dec 5, 2025
…2202) (gh-142239)
The previous test_spawn_doesnt_hang test had a few problems:
* It would cause ENV CHANGED failures if other tests were running
concurrently due to stty changes
* Typing while the test was running could cause it to fail
(cherry picked from commit c0c6514)
Co-authored-by: Sam Gross <colesbury@gmail.com>
colesbury added a commit that referenced this pull request Dec 5, 2025
…2202) (gh-142238)
The previous test_spawn_doesnt_hang test had a few problems:
* It would cause ENV CHANGED failures if other tests were running
concurrently due to stty changes
* Typing while the test was running could cause it to fail
(cherry picked from commit c0c6514)
Co-authored-by: Sam Gross <colesbury@gmail.com>
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
…gh-142202)
The previous test_spawn_doesnt_hang test had a few problems:
* It would cause ENV CHANGED failures if other tests were running
concurrently due to stty changes
* Typing while the test was running could cause it to fail
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@colesbury@bedevere-bot@warsaw