New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_gdb: test_strings() fails with ASCII locale #52805
Comments
http://www.python.org/dev/buildbot/builders/alpha Debian 3.x/builds/67/steps/test/logs/stdio ====================================================================== 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'. |
Patch using raw string instead of the unicode character directly to avoid the locale issue. I'm not sure that we really test unicode support of the gdb library using my patch. I also get another error: << AssertionError: "'\\\\U0001D121'" did not equal expected "'\\U0000d834\\U0000dd21'" >>. The problem is that test_gdb tests sys.maxunicode whereas gdb may use a different Python library (eg. Python2 whereas we are using Python3) not using the same unicode option (narrow vs wide unicode). The test should ask gdb for its sys.maxunicode value. |
Ok, done in a new version of the patch. test_gdb now pass with and without locale (utf8 and ascii). The patch is for py3k. test_gdb in Python trunk doesn't test has the unicode tests in test_strings() function. |
r81375 improves unicode support of libpython.py. I hope that it will be enough to fix test_strings() failures. |
Ok, buildbots seem happy: "alpha Debian 3.x" is green again. Python 3.1 doesn't have libpython.py: commit blocked (r81376). I forward ported some code from py3k to trunk to fix support of non-BMP unicode characters: r81377. Commit blocked in py3k (r81378) and 2.6 (r81379). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: