From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#5794: 23.1; UnicodeEncodeError in python-shell Date: Sat, 10 Apr 2010 14:21:40 -0400 Message-ID: <87iq7znp6z.fsf@stupidchicken.com> References: <20100329043809.GA5325@bbone> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1270924135 24867 80.91.229.12 (10 Apr 2010 18:28:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Apr 2010 18:28:55 +0000 (UTC) Cc: Max Arnold , 5794@debbugs.gnu.org To: Dave Love Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 10 20:28:53 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O0fQJ-0000HB-Ez for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Apr 2010 20:28:51 +0200 Original-Received: from localhost ([127.0.0.1]:43849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0fQI-0005TT-N0 for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Apr 2010 14:28:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0fQD-0005TE-Vl for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 14:28:46 -0400 Original-Received: from [140.186.70.92] (port=45752 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0fQC-0005T6-JR for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 14:28:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0fQB-0005gx-79 for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 14:28:44 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47749) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0fQB-0005gj-4v for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 14:28:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O0fJh-0003BP-JK; Sat, 10 Apr 2010 14:22:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <20100329043809.GA5325@bbone> Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Apr 2010 18:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5794 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5794-submit@debbugs.gnu.org id=B5794.127092370412226 (code B ref 5794); Sat, 10 Apr 2010 18:22:01 +0000 Original-Received: (at 5794) by debbugs.gnu.org; 10 Apr 2010 18:21:44 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0fJQ-0003B9-Bv for submit@debbugs.gnu.org; Sat, 10 Apr 2010 14:21:44 -0400 Original-Received: from pantheon-po15.its.yale.edu ([130.132.50.71]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0fJP-0003B4-GV for 5794@debbugs.gnu.org; Sat, 10 Apr 2010 14:21:43 -0400 Original-Received: from furry (173-14-147-246-NewEngland.hfc.comcastbusiness.net [173.14.147.246]) (authenticated bits=0) by pantheon-po15.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o3AILfKZ009497 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 10 Apr 2010 14:21:41 -0400 Original-Received: by furry (Postfix, from userid 1000) id 61486C055; Sat, 10 Apr 2010 14:21:40 -0400 (EDT) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 10 Apr 2010 14:22:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36168 Archived-At: > 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' > =C2=A9 > >>> > > 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 > 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.