From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Max Arnold Newsgroups: gmane.emacs.help Subject: Re: python mode shell and unicode Date: Sun, 28 Mar 2010 23:37:08 +0700 Message-ID: <20100328163708.GA9749@bbone> References: <20100326153543.GA11085@bbone> <4BAE44D0.9090804@easy-emacs.de> <20100328024756.GA4890@bbone> <4BAF044E.7010304@easy-emacs.de> <20100328130822.GA7535@bbone> <4BAF6E31.8020202@easy-emacs.de> 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 1269794317 24503 80.91.229.12 (28 Mar 2010 16:38:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 28 Mar 2010 16:38:37 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 28 18:38:31 2010 Return-path: Envelope-to: geh-help-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 1NvvVM-0000xP-84 for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Mar 2010 18:38:28 +0200 Original-Received: from localhost ([127.0.0.1]:48634 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvvVL-0004Ff-MT for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Mar 2010 12:38:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvvUC-0003pz-QJ for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 12:37:16 -0400 Original-Received: from [140.186.70.92] (port=53862 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvvUB-0003pJ-Ae for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 12:37:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvvU9-0004f8-Mw for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 12:37:15 -0400 Original-Received: from mail-fx0-f224.google.com ([209.85.220.224]:40125) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvvU9-0004f2-Hd for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 12:37:13 -0400 Original-Received: by fxm24 with SMTP id 24so36635fxm.26 for ; Sun, 28 Mar 2010 09:37: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:mail-followup-to:references:mime-version:content-type :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=sx0of1uq5In85zkYaKnrKnUAL/mtXUZbDBaDETbG0LM=; b=xTeSIeX2nV6Od2kOnRQ6wMAW0Gr/WF8cU8iNZctdpfNXu8p1Mjoue7hK07A0yT+NwV IoOIpEJSY/ICDz1G9ArfRLP/AKNmVFSSychqV/iDuVjFoLle0b0R2/vVR70eU5l1iUSA 5mNdPrq/RCDUkzuSa+1V1WafbQAMNLb0UqCqM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; b=WqsFoMQGV1J3SPHrmI5r1HF842u6K0VamjBYuiDvvpTHDW7ZPT7tvwvOPaykbVE3qI k3GUGdscgCx/qodrK+jKCY6bTCvN87D6iHQr3GYb8RjbU/VcUYBMj/7PLdP0F8p3ZP7I P4tGvzaPtTqAWEslx5FIa5t6yuTyxepJUVVVg= Original-Received: by 10.223.24.133 with SMTP id v5mr2371077fab.46.1269794232470; Sun, 28 Mar 2010 09:37:12 -0700 (PDT) Original-Received: from bbone ([212.75.220.126]) by mx.google.com with ESMTPS id 16sm2298497fxm.8.2010.03.28.09.37.11 (version=SSLv3 cipher=RC4-MD5); Sun, 28 Mar 2010 09:37:11 -0700 (PDT) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <4BAF6E31.8020202@easy-emacs.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72512 Archived-At: On Sun, Mar 28, 2010 at 04:56:49PM +0200, Andreas Röhler wrote: > Looks like your problem is rather on the python than the emacs side. > Download it here > http://launchpad.net/python-mode/trunk/5.1.0/+download/python-mode.el > > M-x py-execute-file Ok, I placed (require 'python-mode) to init.el and it seems to be activated (autoloading didn't worked for me). But M-x shows no available completions for py-execute-file: Possible completions are: py-electric-backspace py-electric-colon py-electric-delete py-end-of-def-or-class py-execute-buffer py-execute-def-or-class py-execute-import-or-reload py-execute-region py-execute-string Although C-h f py-execute-file shows it and says it is defined in python-mode.el. Next, quick test with print u'\xA9': 1. Invoke python shell manually: M-x py-shell >>> print u'\xA9' © >>> 2. Create new buffer containing the same print command, switch it to python-mode and use py-execute-buffer: >>> ## working on region in file /usr/tmp/python-9773IlV.py... © >>> 3. Close python shell (opened at step 1) and invoke py-execute-buffer again: Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position 0: ordinal not in range(128) Is this really a python problem? I think there is a difference in how Emacs spawns python process in each case.