Skip to content

gh-159914: Ignore gdb stderr in test_gdb.test_pretty_print - #159916

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:test_gdb
Oct 20, 2026
Merged

vstinner merged 1 commit into
python:mainfrom
vstinner:test_gdb

Conversation

@vstinner

@vstinner vstinner commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

test_strings() gets gdb.host_charset() but fails if gdb writes anything to stderr. For example, it fails if gdb logs the warning:

"/usr/bin/gdb: warning: Couldn't determine a path for the index
cache directory."

Even if stdout contains the expected encoding ("UTF-8").

Change test_gdb to only fail if stdout is empty, ignore stderr otherwise to ignore gdb warnings.

test_strings() gets gdb.host_charset() but fails if gdb writes
anything to stderr. For example, it fails if gdb logs the warning:

    "/usr/bin/gdb: warning: Couldn't determine a path for the index
    cache directory."

Even if stdout contains the expected encoding ("UTF-8").

Change test_gdb to only fail if stdout is empty, ignore stderr
otherwise to ignore gdb warnings.
@vstinner vstinner added tests Tests in the Lib/test dir needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Oct 20, 2026
@vstinner

Copy link
Copy Markdown
Member Author

!buildbot AMD64 Debian root PR

@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @vstinner for commit a5195b5 🤖

Results will be shown at:

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

The command will test the builders whose names match following regular expression: AMD64 Debian root PR

The builders matched are:

  • AMD64 Debian root PR

@vstinner

Copy link
Copy Markdown
Member Author

0:10:11 load avg: 1.52 mem: 83.1 MiB [318/561/1] test.test_gdb.test_pretty_print passed

Good: the test passed on AMD64 Debian root PR!

test_external_inspection failed on this build, but it seems to be a random failure, and it's unrelated to this change:

FAIL: test_popping_python_frame_is_not_native (test.test_external_inspection.TestGetStackTrace.test_popping_python_frame_is_not_native)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/buildarea/pull_request.angelico-debian-amd64/build/Lib/test/test_external_inspection.py", line 1980, in test_popping_python_frame_is_not_native
    self.assertGreater(samples, 1000)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
AssertionError: 0 not greater than 1000

@vstinner
vstinner merged commit 88d922a into python:main Oct 20, 2026
60 of 61 checks passed
@vstinner
vstinner deleted the test_gdb branch October 20, 2026 18:48
@miss-islington-app

Copy link
Copy Markdown

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

@bedevere-app

bedevere-app Bot commented Oct 20, 2026

Copy link
Copy Markdown

GH-159939 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 20, 2026
@bedevere-app

bedevere-app Bot commented Oct 20, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 20, 2026
vstinner added a commit that referenced this pull request Oct 20, 2026
…-159916) (#159939)

gh-159914: Ignore gdb stderr in test_gdb.test_pretty_print (GH-159916)

test_strings() gets gdb.host_charset(), but fails if gdb writes
anything to stderr. For example, it fails if gdb logs the warning:

    "/usr/bin/gdb: warning: Couldn't determine a path for the index
    cache directory."

Even if stdout contains the expected encoding ("UTF-8").

Change test_gdb to only fail if stdout is empty, ignore stderr
otherwise to ignore gdb warnings.
(cherry picked from commit 88d922a)

Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner added a commit that referenced this pull request Oct 20, 2026
…-159916) (#159940)

gh-159914: Ignore gdb stderr in test_gdb.test_pretty_print (GH-159916)

test_strings() gets gdb.host_charset(), but fails if gdb writes
anything to stderr. For example, it fails if gdb logs the warning:

    "/usr/bin/gdb: warning: Couldn't determine a path for the index
    cache directory."

Even if stdout contains the expected encoding ("UTF-8").

Change test_gdb to only fail if stdout is empty, ignore stderr
otherwise to ignore gdb warnings.
(cherry picked from commit 88d922a)

Co-authored-by: Victor Stinner <vstinner@python.org>
@vstinner vstinner added the needs backport to 3.13 only security fixes label Oct 22, 2026
@miss-islington-app

Copy link
Copy Markdown

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

@bedevere-app

bedevere-app Bot commented Oct 22, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Oct 22, 2026
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.

2 participants