From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Max Arnold Newsgroups: gmane.emacs.bugs Subject: bug#5794: 23.1; UnicodeEncodeError in python-shell Date: Sun, 11 Apr 2010 09:47:52 +0700 Message-ID: <20100411024752.GA4953@bbone> References: <87iq7znp6z.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: dough.gmane.org 1270956535 10863 80.91.229.12 (11 Apr 2010 03:28:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Apr 2010 03:28:55 +0000 (UTC) Cc: 5794@debbugs.gnu.org, Dave Love To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 11 05: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 1O0nqv-000226-20 for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Apr 2010 05:28:53 +0200 Original-Received: from localhost ([127.0.0.1]:52474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0nqu-0002J5-3l for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Apr 2010 23:28:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0nqo-0002Ip-RV for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 23:28:46 -0400 Original-Received: from [140.186.70.92] (port=59316 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0nqm-0002Ih-IQ for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 23:28:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0nql-0000Ad-20 for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 23:28:44 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48051) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0nql-0000AX-0Q for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 23:28:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O0nkI-0007Tw-H4; Sat, 10 Apr 2010 23:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Max Arnold Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Apr 2010 03:22:02 +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.127095609028747 (code B ref 5794); Sun, 11 Apr 2010 03:22:02 +0000 Original-Received: (at 5794) by debbugs.gnu.org; 11 Apr 2010 03:21:30 +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 1O0njl-0007Tb-OO for submit@debbugs.gnu.org; Sat, 10 Apr 2010 23:21:30 -0400 Original-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 Original-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= Original-Received: by 10.103.50.13 with SMTP id c13mr1007845muk.63.1270954076978; Sat, 10 Apr 2010 19:47:56 -0700 (PDT) Original-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) Content-Disposition: inline In-Reply-To: <87iq7znp6z.fsf@stupidchicken.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Sat, 10 Apr 2010 23:21:28 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 10 Apr 2010 23:22:02 -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:36182 Archived-At: 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.