GNU bug report logs -
#5794
23.1; UnicodeEncodeError in python-shell
Previous Next
Reported by: Max Arnold <lwarxx <at> gmail.com>
Date: Mon, 29 Mar 2010 05:01:01 UTC
Severity: normal
Done: Chong Yidong <cyd <at> stupidchicken.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> 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 python-shell
> >>> print u'\xA9'
> ©
> >>>
>
> 2. And this is how to trigger the error: close python shell opened at
> step (1), create new buffer containing the same print command, switch
> it to python-mode and press C-c C-c (python-send-buffer). Spawned
> python shell will show a traceback:
> >>> Traceback (most recent call last):
> File "/tmp/py5308nvC", line 1, in <module>
> print u'\xA9'
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in
> position 0: ordinal not in range(128)
This is due to the following line in `run-python', which I merged from
the upstream python.el on 2008-02-21:
;; Suppress use of pager for help output:
(process-connection-type nil))
Dave, do you remember what the rationale for this is? (I don't
understand the comment.)
I'm not sure why using a pipe rather than a pty makes a difference,
though.
This bug report was last modified 14 years and 336 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.