Skip to content

[3.13] gh-159914: Ignore gdb stderr in test_gdb.test_pretty_print (GH-159916) - #160201

Merged
Yhg1s merged 1 commit into
python:3.13from
miss-islington:backport-88d922a-3.13
Oct 24, 2026
Merged

Yhg1s merged 1 commit into
python:3.13from
miss-islington:backport-88d922a-3.13

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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

…honGH-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

Copy link
Copy Markdown
Member

@Yhg1s: The 3.13 branch only accept security fixes. But the 3.13 branch is marked as "unreleasable" because test_gdb fails on a Tier-1 buildbot (AMD64 Debian root 3.13). Do you accept fixes to repair the 3.13 buildbots?

@Yhg1s
Yhg1s merged commit d9b6c22 into python:3.13 Oct 24, 2026
43 checks passed
@miss-islington
miss-islington deleted the backport-88d922a-3.13 branch October 24, 2026 21:03
@hugovk

hugovk commented Oct 25, 2026

Copy link
Copy Markdown
Member

Also failing on:

ERROR: test_strings (test.test_gdb.test_pretty_print.PrettyPrintTests.test_strings)
Verify the pretty-printing of unicode strings
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/buildarea/3.12.angelico-debian-amd64/build/Lib/test/test_gdb/test_pretty_print.py", line 120, in test_strings
    raise RuntimeError(
RuntimeError: unable to determine the Python locale preferred encoding of embedded Python in GDB
stdout='UTF-8\n'
stderr="/usr/bin/gdb: warning: Couldn't determine a path for the index cache directory.\n"

----------------------------------------------------------------------

@hugovk hugovk added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Oct 25, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @miss-islington for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @miss-islington for the PR, and @Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @miss-islington and @Yhg1s, I could not cleanly backport this to 3.11 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker d9b6c229f233eb26952d81381b375f9d6bb99c19 3.11

@miss-islington-app

Copy link
Copy Markdown

Sorry, @miss-islington and @Yhg1s, I could not cleanly backport this to 3.12 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker d9b6c229f233eb26952d81381b375f9d6bb99c19 3.12

@bedevere-app

bedevere-app Bot commented Oct 25, 2026

Copy link
Copy Markdown

GH-160650 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Oct 25, 2026
@bedevere-app

bedevere-app Bot commented Oct 25, 2026

Copy link
Copy Markdown

GH-160651 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.11 only security fixes label Oct 25, 2026
Yhg1s pushed a commit that referenced this pull request Oct 25, 2026
…-159916) (GH-160201) (#160650)

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)
(cherry picked from commit d9b6c22)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
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.

4 participants