From: Chong Yidong <cyd@stupidchicken.com>
To: Dave Love <fx@gnu.org>
Cc: Max Arnold <lwarxx@gmail.com>, 5794@debbugs.gnu.org
Subject: bug#5794: 23.1; UnicodeEncodeError in python-shell
Date: Sat, 10 Apr 2010 14:21:40 -0400 [thread overview]
Message-ID: <87iq7znp6z.fsf@stupidchicken.com> (raw)
In-Reply-To: <20100329043809.GA5325@bbone>
> 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.
next prev parent reply other threads:[~2010-04-10 18:21 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 [this message]
2010-04-11 2:47 ` Max Arnold
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=87iq7znp6z.fsf@stupidchicken.com \
--to=cyd@stupidchicken.com \
--cc=5794@debbugs.gnu.org \
--cc=fx@gnu.org \
--cc=lwarxx@gmail.com \
/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.