all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Cc: python-mode@python.org
Subject: Re: python mode shell and unicode
Date: Sun, 28 Mar 2010 16:56:49 +0200	[thread overview]
Message-ID: <4BAF6E31.8020202@easy-emacs.de> (raw)
In-Reply-To: <20100328130822.GA7535@bbone>

Max Arnold wrote:
> On Sun, Mar 28, 2010 at 09:25:02AM +0200, Andreas Röhler wrote:
>> Hmm, see inside `python-send-region'
>>
>>   ;; Fixme: Write a `coding' header to the temp file if the region is
>>   ;; non-ASCII.
>>
>> Maybe that indicates the cause?
> 
> I think this is unrelated to the issue because my python code contains no
> unicode characters; they are received from parsed web page and then printed
> to stdout. The problem is with python process spawned by Emacs - its stdout
> encoding is not specified (sys.stdout.encoding is None).
> 
> Maybe this is a python feature: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415968
> 
> But then I do not understand why manually invoked pyton-shell handles unicode
> characters just fine...

Looks like your problem is rather on the python than the emacs side.

If I change the function in the bugreport given above into

def output(s):
    # print s.decode('utf-8')
    print s

redirecting into FILE with > works


> 
>> You could try `py-execute-file' from python-mode.el
> 
> Sorry, didn't mentioned that I use python.el shipped with emacs. How to disable
> built-in one and enable python-mode.el? 

Download it here

http://launchpad.net/python-mode/trunk/5.1.0/+download/python-mode.el

and get it loaded

 How to invoke py-execute-file from
> M-x prompt?

Just

M-x py-execute-file

should do it

Andreas

> 
> BTW, print u'\xA9' is a nice test for this issue.
> 
> Cheers, Max
> 
> 
> 

_______________________________________________
Python-mode mailing list
Python-mode@python.org
http://mail.python.org/mailman/listinfo/python-mode

  reply	other threads:[~2010-03-28 14:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-26 15:35 python mode shell and unicode Max Arnold
2010-03-27 17:48 ` Andreas Röhler
2010-03-28  2:47   ` Max Arnold
2010-03-28  7:25     ` Andreas Röhler
2010-03-28 13:08       ` Max Arnold
2010-03-28 14:56         ` Andreas Röhler [this message]
2010-03-28 16:37           ` Max Arnold
2010-03-28 16:34             ` Andreas Röhler
2010-03-28 17:58               ` Max Arnold
2010-03-28 17:28                 ` Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BAF6E31.8020202@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=python-mode@python.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.