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: Mon, 29 Mar 2010 11:38:09 +0700 Message-ID: <20100329043809.GA5325@bbone> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1269896334 1736 80.91.229.12 (29 Mar 2010 20:58:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 29 Mar 2010 20:58:54 +0000 (UTC) To: 5794@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 29 22:58:48 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 1NwM2l-0004aq-K6 for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Mar 2010 22:58:44 +0200 Original-Received: from localhost ([127.0.0.1]:54925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwM2k-0002kE-TQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Mar 2010 16:58:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nw7Tm-0007IY-LP for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2010 01:25:38 -0400 Original-Received: from [140.186.70.92] (port=56051 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nw7Tj-0007Gb-Cx for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2010 01:25:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nw7Ti-00014r-5w for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2010 01:25:35 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57253) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nw7Ti-00014l-24 for bug-gnu-emacs@gnu.org; Mon, 29 Mar 2010 01:25:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Nw75x-0002dm-SG; Mon, 29 Mar 2010 01:01:01 -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: Mon, 29 Mar 2010 05:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 5794 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.126983885510140 (code B ref -1); Mon, 29 Mar 2010 05:01:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Mar 2010 05:00:55 +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 1Nw75q-0002dV-P4 for submit@debbugs.gnu.org; Mon, 29 Mar 2010 01:00:55 -0400 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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= Original-Received: by 10.223.63.76 with SMTP id a12mr3886386fai.10.1269837492499; Sun, 28 Mar 2010 21:38:12 -0700 (PDT) Original-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) Content-Disposition: inline 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-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 Resent-Date: Mon, 29 Mar 2010 01:01:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Mon, 29 Mar 2010 16:54:37 -0400 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:35795 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' © >>> 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...