Skip to content

Commit 284c40b

Browse files
hugovkmiss-islingtonvstinner
authored
[3.12] gh-159914: Ignore gdb stderr in test_gdb.test_pretty_print (GH-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>
1 parent e4500d8 commit 284c40b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Lib/test/test_gdb/test_pretty_print.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_strings(self):
116116
'python import locale; print(locale.getpreferredencoding())')
117117

118118
encoding = stdout
119-
if stderr or not encoding:
119+
if not encoding:
120120
raise RuntimeError(
121121
f'unable to determine the Python locale preferred encoding '
122122
f'of embedded Python in GDB\n'

0 commit comments

Comments
 (0)