bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#5794: 23.1; UnicodeEncodeError in python-shell


From: Chong Yidong
Subject: bug#5794: 23.1; UnicodeEncodeError in python-shell
Date: Sat, 10 Apr 2010 14:21:40 -0400

> 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.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]