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: Max Arnold
Subject: bug#5794: 23.1; UnicodeEncodeError in python-shell
Date: Sun, 11 Apr 2010 09:47:52 +0700
User-agent: Mutt/1.5.20 (2009-06-14)

On Sat, Apr 10, 2010 at 02:21:40PM -0400, Chong Yidong wrote:
> > >>> 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 is probably for python builtin help() function, which can use pager
to scroll documentation page by page. When help() detects that terminal is
a pipe, it disables interactive scrolling and just prints full output as is.
Try this for example:

import os
help(os)

Fortunately, python understands $PAGER environment variable and will use it
for scrolling, so PAGER="cat" will have the same effect as using pipe.

Hope this helps.






reply via email to

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