From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?QW5kcmVhcyBSw7ZobGVy?= Newsgroups: gmane.emacs.help,gmane.emacs.python-mode Subject: Re: python mode shell and unicode Date: Sun, 28 Mar 2010 18:34:06 +0200 Message-ID: <4BAF84FE.4040205@easy-emacs.de> 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> <20100328163708.GA9749@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 1269797504 2315 80.91.229.12 (28 Mar 2010 17:31:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 28 Mar 2010 17:31:44 +0000 (UTC) Cc: python-mode@python.org 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 19:31:39 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 1NvwKo-0001Kk-Un for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Mar 2010 19:31:39 +0200 Original-Received: from localhost ([127.0.0.1]:49794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvwKo-0003Um-8i for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Mar 2010 13:31:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvwKJ-0003Ro-Qe for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 13:31:07 -0400 Original-Received: from [140.186.70.92] (port=40247 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvwKI-0003Od-Fy for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 13:31:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvwKF-0001Ix-Rn for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 13:31:06 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.186]:56665) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvwKF-0001Ih-H8 for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 13:31:03 -0400 Original-Received: from [192.168.178.27] (p54BE9354.dip0.t-ipconnect.de [84.190.147.84]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MbaQ1-1OCEmu1DGv-00J8v8; Sun, 28 Mar 2010 19:31:01 +0200 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: <20100328163708.GA9749@bbone> X-Provags-ID: V01U2FsdGVkX18ligbH4ghxmSp4WZcsCakpRgkDbHt65UR+BjB 3doBe/CYUUS6WGTV3C7ZwT7X5n4G3g1Im3Utzg+uU4j8yXtF3Q PWBNV30GSsDrC+KyR7+/Dkqy1mfFyUUADBVjisDbbE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:72518 gmane.emacs.python-mode:464 Archived-At: Max Arnold wrote: > 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... > © > So that's what it should do(?) > > 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. > > > Hmm, yes, get the same error. However, if I re-start ipython-shell parallel it works again In [11]: ## working on region in file /usr/tmp/python-3766xFD.py... © Maybe just start a python-shell to have a work-around? Sorry, I'm not able to dive into now. It may help, if you make a bug-report, having it noticed at least here: https://bugs.launchpad.net/python-mode Thanks Andreas