Issue 8559: test_gdb: test_strings() fails with ASCII locale (original) (raw)

http://www.python.org/dev/buildbot/builders/alpha Debian 3.x/builds/67/steps/test/logs/stdio

====================================================================== ERROR: test_strings (test.test_gdb.PrettyPrintTests) Verify the pretty-printing of unicode strings

Traceback (most recent call last): File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_gdb.py", line 230, in test_strings self.assertGdbRepr('\u2620') File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_gdb.py", line 176, in assertGdbRepr cmds_after_breakpoint) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_gdb.py", line 144, in get_gdb_repr import_site=import_site) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_gdb.py", line 120, in get_stack_trace out, err = self.run_gdb(*args) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/test/test_gdb.py", line 60, in run_gdb args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/subprocess.py", line 670, in init restore_signals, start_new_session) File "/home/doko/buildarea/3.x.klose-debian-alpha/build/Lib/subprocess.py", line 1115, in _execute_child restore_signals, start_new_session, preexec_fn) UnicodeEncodeError: 'ascii' codec can't encode character '\u2620' in position 4: ordinal not in range(128)

You can try with: "LANG= ./python Lib/test/regrtest.py test_gdb".

We should skip the test if '\u2620' is not encodable to sys.getfileystemencoding(), or maybe use '\u2620'.