From: Max Arnold <lwarxx@gmail.com>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 5794@debbugs.gnu.org, Dave Love <fx@gnu.org>
Subject: bug#5794: 23.1; UnicodeEncodeError in python-shell
Date: Sun, 11 Apr 2010 09:47:52 +0700 [thread overview]
Message-ID: <20100411024752.GA4953@bbone> (raw)
In-Reply-To: <87iq7znp6z.fsf@stupidchicken.com>
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.
next prev parent reply other threads:[~2010-04-11 2:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-29 4:38 bug#5794: 23.1; UnicodeEncodeError in python-shell Max Arnold
2010-04-10 18:21 ` Chong Yidong
2010-04-11 2:47 ` Max Arnold [this message]
2010-04-12 23:04 ` Dave Love
2010-04-12 23:08 ` Dave Love
2010-08-24 20:22 ` Chong Yidong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100411024752.GA4953@bbone \
--to=lwarxx@gmail.com \
--cc=5794@debbugs.gnu.org \
--cc=cyd@stupidchicken.com \
--cc=fx@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.