From unknown Wed Aug 20 06:40:08 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#5794 <5794@debbugs.gnu.org> To: bug#5794 <5794@debbugs.gnu.org> Subject: Status: 23.1; UnicodeEncodeError in python-shell Reply-To: bug#5794 <5794@debbugs.gnu.org> Date: Wed, 20 Aug 2025 13:40:08 +0000 retitle 5794 23.1; UnicodeEncodeError in python-shell reassign 5794 emacs submitter 5794 Max Arnold severity 5794 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 29 01:00:55 2010 Received: (at submit) by debbugs.gnu.org; 29 Mar 2010 05:00:55 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nw75q-0002dV-P4 for submit@debbugs.gnu.org; Mon, 29 Mar 2010 01:00:55 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nw6k3-0002Uh-7c for submit@debbugs.gnu.org; Mon, 29 Mar 2010 00:38:24 -0400 Received: from lists.gnu.org ([199.232.76.165]:42294) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nw6jz-0002Br-T8 for submit@debbugs.gnu.org; Mon, 29 Mar 2010 00:38:19 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nw6jz-0007it-DI for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2010 00:38:19 -0400 Received: from [140.186.70.92] (port=53102 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nw6jx-0007h8-4x for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2010 00:38:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID,T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.0 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nw6ju-00049l-Od for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2010 00:38:17 -0400 Received: from mail-fx0-f224.google.com ([209.85.220.224]:33209) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nw6ju-00049e-IP for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2010 00:38:14 -0400 Received: by fxm24 with SMTP id 24so283987fxm.26 for ; Sun, 28 Mar 2010 21:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:mime-version:content-type:content-disposition :content-transfer-encoding:user-agent; bh=SFLgZJxiRizzsJobOCilxdnoD/ooqg3bhVlv5XTvrP4=; b=wrj+dnzgXIlvg5G/swW5Ol/cnk4ZE2CMWtWBFKFRQAlKxdGFpp8RKePqvNphZMPIuz hNOMoRbqAbdfG8W8BgZ4mWawifaiB7UewHdShUn+2I4onqGFiGXnasUP93VlB7lqIYSH MztpGsir0p7thhcZA7xvZ86zTVkM+hxONOm0k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:content-transfer-encoding:user-agent; b=oWcB0kIAUqnvDRmhX/5WPDZocun43VoH/iE/BNNqWdOAUdvzIrVFt7e9SlyJ1R5UNP /vTXYyn3CKrSvhhkk97smYywgSfeSerGG3zhaCOWAzjDAeYKZ/CgSZ8H6bi8Y+P1aEhR C0WxZA/dEbVY+kMDzRYddgJ77UMgFvkXKTQXk= Received: by 10.223.63.76 with SMTP id a12mr3886386fai.10.1269837492499; Sun, 28 Mar 2010 21:38:12 -0700 (PDT) Received: from bbone ([212.75.220.126]) by mx.google.com with ESMTPS id 13sm2677582fxm.10.2010.03.28.21.38.11 (version=SSLv3 cipher=RC4-MD5); Sun, 28 Mar 2010 21:38:12 -0700 (PDT) Date: Mon, 29 Mar 2010 11:38:09 +0700 From: Max Arnold To: bug-gnu-emacs@gnu.org Subject: 23.1; UnicodeEncodeError in python-shell Message-ID: <20100329043809.GA5325@bbone> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 29 Mar 2010 01:00:53 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) 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 print u'\xA9' UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position 0: ordinal not in range(128) >>> Emacs was running with -nw mode in rxvt-unicode terminal, system-wide LANG is set to ru_RU.UTF-8. On step (1) sys.stdout.encoding is UTF-8, on step (2) it is None. The same issue was found using python-mode.el (https://bugs.launchpad.net/python-mode/+bug/550661). For more details see this thread: http://lists.gnu.org/archive/html/help-gnu-emacs/2010-03/msg00233.html In GNU Emacs 23.1.1 (i686-pc-linux-gnu, GTK+ Version 2.14.7) of 2009-12-15 on bbone configured using `configure '--prefix=/usr' '--build=i686-pc-linux-gnu' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--program-suffix=-emacs-23' '--infodir=/usr/share/info/emacs-23' '--with-sound' '--with-x' '--with-toolkit-scroll-bars' '--without-gif' '--without-jpeg' '--without-png' '--without-rsvg' '--without-tiff' '--without-xpm' '--with-xft' '--without-libotf' '--without-m17n-flt' '--with-x-toolkit=gtk' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--with-gpm' '--with-dbus' 'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu' 'CFLAGS=-march=i686 -O2 -pipe' 'LDFLAGS=-Wl,-O1'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ru_RU.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: shell-dirtrack-mode: t show-paren-mode: t iswitchb-mode: t global-hl-line-mode: t ergoemacs-mode: t delete-selection-mode: t tooltip-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: ESC a r e p o TAB r t - e TAB RET Recent messages: ("emacs") Loading ~/.emacs.d/ergoemacs-mode/5.1/ergoemacs-mode (compiled; note, source file is newer)... Loading functions...done Loading ergoemacs-unbind...done Loading ergoemacs-layout-us...done Loading ~/.emacs.d/ergoemacs-mode/5.1/ergoemacs-mode (compiled; note, source file is newer)...done Ido mode enabled [3 times] For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 10 14:21:44 2010 Received: (at 5794) by debbugs.gnu.org; 10 Apr 2010 18:21:44 +0000 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 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 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 Received: by furry (Postfix, from userid 1000) id 61486C055; Sat, 10 Apr 2010 14:21:40 -0400 (EDT) From: Chong Yidong To: Dave Love Subject: Re: 23.1; UnicodeEncodeError in python-shell Date: Sat, 10 Apr 2010 14:21:40 -0400 Message-ID: <87iq7znp6z.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 5794 Cc: Max Arnold , 5794@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 10 23:21:30 2010 Received: (at 5794) by debbugs.gnu.org; 11 Apr 2010 03:21:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0njl-0007Tb-OO for submit@debbugs.gnu.org; Sat, 10 Apr 2010 23:21:30 -0400 Received: from fg-out-1718.google.com ([72.14.220.154]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0nDK-0007EC-LD for 5794@debbugs.gnu.org; Sat, 10 Apr 2010 22:47:59 -0400 Received: by fg-out-1718.google.com with SMTP id 22so86667fge.15 for <5794@debbugs.gnu.org>; Sat, 10 Apr 2010 19:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=RxFkxvjhcfEBCRYo2p9g9UWjptgvuLFYnbwyzOOLst0=; b=ALLqf+ZZRz29o86pm49s2sFplawdOvI/83SbpyROzJikeldkoJsZzxVG/w2pOqkQ0W A9VjCJ8w33FSbi24HJFd4xFVvn0kD/rB43fJQrdgcRu0ah4G6bOrEgZ7k9gyOxUfYUqI YvKj7W8msj1nBdgV/8+VtXiGilZEjATj4UNVE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=S8SbyP54rJR7EqihedDTXGlMrXDaU++pA4fUI6xjcHI6cVw/52AwUopgNG21SHBB6S 82bSIBjFxQKhvNYKK1kwITZkxTqPybpIUpx9/A9NoykbdGC5wbrQXFiZNMwAvK6AOB1o K3K220Z09OSpWJMDmiPYEoObg6CYS1pUKTT3M= Received: by 10.103.50.13 with SMTP id c13mr1007845muk.63.1270954076978; Sat, 10 Apr 2010 19:47:56 -0700 (PDT) Received: from bbone ([212.75.220.126]) by mx.google.com with ESMTPS id i7sm11516825mue.4.2010.04.10.19.47.54 (version=SSLv3 cipher=RC4-MD5); Sat, 10 Apr 2010 19:47:55 -0700 (PDT) Date: Sun, 11 Apr 2010 09:47:52 +0700 From: Max Arnold To: Chong Yidong Subject: Re: 23.1; UnicodeEncodeError in python-shell Message-ID: <20100411024752.GA4953@bbone> References: <87iq7znp6z.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87iq7znp6z.fsf@stupidchicken.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: 5794 X-Mailman-Approved-At: Sat, 10 Apr 2010 23:21:28 -0400 Cc: 5794@debbugs.gnu.org, Dave Love X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.7 (---) On Sat, Apr 10, 2010 at 02:21:40PM -0400, Chong Yidong wrote: > > >>> 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. 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 12 19:08:10 2010 Received: (at 5794) by debbugs.gnu.org; 12 Apr 2010 23:08:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1Sjh-0003A0-Ou for submit@debbugs.gnu.org; Mon, 12 Apr 2010 19:08:10 -0400 Received: from mail169.messagelabs.com ([85.158.138.179]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1O1Sgi-00038L-HA for 5794@debbugs.gnu.org; Mon, 12 Apr 2010 19:05:05 -0400 X-VirusChecked: Checked X-Env-Sender: D.Love@liverpool.ac.uk X-Msg-Ref: server-8.tower-169.messagelabs.com!1271113499!19277905!1 X-StarScan-Version: 6.2.4; banners=-,-,- X-Originating-IP: [138.253.100.159] Received: (qmail 20295 invoked from network); 12 Apr 2010 23:04:59 -0000 Received: from mxe.liv.ac.uk (HELO mxe.liv.ac.uk) (138.253.100.159) by server-8.tower-169.messagelabs.com with SMTP; 12 Apr 2010 23:04:59 -0000 Received: from mailhubd.liv.ac.uk ([138.253.100.81]) by mxe.liv.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1O1Sgd-0001Re-DR; Tue, 13 Apr 2010 00:04:59 +0100 Received: from localhost ([127.0.0.1] helo=mailhubd.liv.ac.uk) by mailhubd.liv.ac.uk with esmtp (Exim 4.67) (envelope-from ) id 1O1Sgd-0002jx-Bv; Tue, 13 Apr 2010 00:04:59 +0100 Received: from pc102091.liv.ac.uk ([138.253.102.91] helo=albion) by mailhubd.liv.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1O1Sgd-0002ju-8C; Tue, 13 Apr 2010 00:04:59 +0100 Received: from dlove by albion with local (Exim 4.69) (envelope-from ) id 1O1Sgc-0001bK-To; Tue, 13 Apr 2010 00:04:58 +0100 From: Dave Love To: Chong Yidong Subject: Re: 23.1; UnicodeEncodeError in python-shell References: <87iq7znp6z.fsf@stupidchicken.com> X-Draft-From: ("nnimap+imap.liv.ac.uk:Misc" 6292) X-Plaque: Raised by Men of Liverpool for the Advancement of Learning and the Enoblement of Life Date: Tue, 13 Apr 2010 00:04:58 +0100 Message-ID: <87633w5l2d.fsf@liv.ac.uk> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 5794 X-Mailman-Approved-At: Mon, 12 Apr 2010 19:08:08 -0400 Cc: Max Arnold , "5794@debbugs.gnu.org" <5794@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.4 (-----) Chong Yidong writes: > 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.) It's the most likely way to suppress interactive i/o generally, which is why it should normally be used for inferior interpreters and things like VC, apart from the reasons in the manual to avoid PTYs. > I'm not sure why using a pipe rather than a pty makes a difference, > though. It's certainly odd behaviour, but as you're dropping python.el for python-mode.el, you needn't worry about it. Amongst other things, python-mode.el doesn't have the features that require results from the sub-process. From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 12 19:08:24 2010 Received: (at 5794) by debbugs.gnu.org; 12 Apr 2010 23:08:24 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1Sjw-0003AF-9i for submit@debbugs.gnu.org; Mon, 12 Apr 2010 19:08:24 -0400 Received: from mail188.messagelabs.com ([85.158.139.163]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1O1Sjt-0003A8-LZ for 5794@debbugs.gnu.org; Mon, 12 Apr 2010 19:08:22 -0400 X-VirusChecked: Checked X-Env-Sender: D.Love@liverpool.ac.uk X-Msg-Ref: server-7.tower-188.messagelabs.com!1271113696!43830321!1 X-StarScan-Version: 6.2.4; banners=-,-,- X-Originating-IP: [138.253.100.159] Received: (qmail 12500 invoked from network); 12 Apr 2010 23:08:16 -0000 Received: from mxe.liv.ac.uk (HELO mxe.liv.ac.uk) (138.253.100.159) by server-7.tower-188.messagelabs.com with SMTP; 12 Apr 2010 23:08:16 -0000 Received: from mailhube.liv.ac.uk ([138.253.100.157]) by mxe.liv.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1O1Sjo-0001UZ-Jx for 5794@debbugs.gnu.org; Tue, 13 Apr 2010 00:08:16 +0100 Received: from localhost ([127.0.0.1] helo=mailhube.liv.ac.uk) by mailhube.liv.ac.uk with esmtp (Exim 4.67) (envelope-from ) id 1O1Sjo-0005ed-Hr; Tue, 13 Apr 2010 00:08:16 +0100 Received: from pc102091.liv.ac.uk ([138.253.102.91] helo=albion) by mailhube.liv.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1O1Sjo-0005ea-E8; Tue, 13 Apr 2010 00:08:16 +0100 Received: from dlove by albion with local (Exim 4.69) (envelope-from ) id 1O1Sjo-0001ba-Cw; Tue, 13 Apr 2010 00:08:16 +0100 From: Dave Love To: Max Arnold Subject: Re: 23.1; UnicodeEncodeError in python-shell References: <87iq7znp6z.fsf@stupidchicken.com> <20100411024752.GA4953@bbone> X-Draft-From: ("nnimap+imap.liv.ac.uk:Misc" 6293) X-Plaque: Raised by Men of Liverpool for the Advancement of Learning and the Enoblement of Life Date: Tue, 13 Apr 2010 00:08:16 +0100 Message-ID: <874ojg5kwv.fsf@liv.ac.uk> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 5794 Cc: "5794@debbugs.gnu.org" <5794@debbugs.gnu.org>, Chong Yidong X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) Max Arnold writes: > Fortunately, python understands $PAGER environment variable and will use it > for scrolling, so PAGER="cat" will have the same effect as using pipe. I assume it will lose on MS Windows, which is why I rejected it, not that I have any interest in MS Windows. For a working version see http://www.loveshack.ukfsn.org/emacs/. As far as I know it doesn't have any unfixed reported bugs, or any of the bugs people keep reporting to me against the fork in Emacs. You might want it anyway when things like symbol help and completion are dropped from Emacs, or for things like Python 3 support now. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 24 16:21:23 2010 Received: (at 5794) by debbugs.gnu.org; 24 Aug 2010 20:21:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Onzzn-0006ut-C8 for submit@debbugs.gnu.org; Tue, 24 Aug 2010 16:21:23 -0400 Received: from pantheon-po15.its.yale.edu ([130.132.50.71]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Onzzl-0006ul-Qy for 5794@debbugs.gnu.org; Tue, 24 Aug 2010 16:21:22 -0400 Received: from furry (dhcp128036014154.central.yale.edu [128.36.14.154]) (authenticated bits=0) by pantheon-po15.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o7OKMg9c009346 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 24 Aug 2010 16:22:42 -0400 Received: by furry (Postfix, from userid 1000) id 613F4C013; Tue, 24 Aug 2010 16:22:41 -0400 (EDT) From: Chong Yidong To: Max Arnold Subject: Re: 23.1; UnicodeEncodeError in python-shell Date: Tue, 24 Aug 2010 16:22:41 -0400 Message-ID: <874oejbw1a.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 5794 Cc: 5794@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) >>> When python shell invoked via C-c C-c, its stdout encoding is set to >>> None and unicode characters can not be printed. > >> This is due to the following line in `run-python' >> (process-connection-type nil)) >> 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. I've changed python.el in the trunk to use a pty; this should remove the problem. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 24 16:21:32 2010 Received: (at control) by debbugs.gnu.org; 24 Aug 2010 20:21:32 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Onzzw-0006v5-H3 for submit@debbugs.gnu.org; Tue, 24 Aug 2010 16:21:32 -0400 Received: from pantheon-po15.its.yale.edu ([130.132.50.71]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Onzzv-0006v0-FP for control@debbugs.gnu.org; Tue, 24 Aug 2010 16:21:31 -0400 Received: from furry (dhcp128036014154.central.yale.edu [128.36.14.154]) (authenticated bits=0) by pantheon-po15.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o7OKMqst009370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 24 Aug 2010 16:22:52 -0400 Received: by furry (Postfix, from userid 1000) id 79417C013; Tue, 24 Aug 2010 16:22:52 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 5794 Date: Tue, 24 Aug 2010 16:22:52 -0400 Message-ID: <871v9nbw0z.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) close 5794 thanks From unknown Wed Aug 20 06:40:08 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 22 Sep 2010 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator