UnicodeEncodeError in python-mode shell
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Undecided
|
Andreas Roehler |
Bug Description
When python shell invoked via C-c C-c, its stdout encoding is set to None and unicode characters can not be printed. Simple test case (0xA9 should produce unicode symbol (c) ):
1. Invoke python shell manually:
M-x py-shell
>>> print u'\xA9'
©
>>>
2. Create new buffer containing the same print command, switch it to python-mode and use py-execute-buffer:
>>> ## working on region in file /usr/tmp/
©
>>>
3. And this is how to trigger the error: close python shell opened at step (1) and invoke py-execute-buffer again:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position 0: ordinal not in
range(128)
This test was executed on Linux with Emacs-23.1 and latest python-mode.el. Emacs was running with -nw mode in rxvt-unicode terminal, system-wide LANG is set to ru_RU.UTF-8. On steps (1) and (2) sys.stdout.encoding is UTF-8, on step (3) it is None.
For more details see this thread: http://
Related branches
- python-mode.el developers: Pending requested
-
Diff: 5004 lines (+2516/-1849)5 files modifiedUnicodeEncodeError-lp:550661-test.py (+4/-0)
py-bug-numbered-tests.el (+738/-245)
python-mode-test.el (+202/-0)
python-mode-tests.sh (+88/-0)
python-mode.el (+1484/-1604)
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
Changed in python-mode: | |
status: | New → Confirmed |
Changed in python-mode: | |
status: | Confirmed → Fix Committed |
Changed in python-mode: | |
milestone: | none → 6.0 |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |