help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: python mode shell and unicode


From: Andreas Röhler
Subject: Re: python mode shell and unicode
Date: Sun, 28 Mar 2010 09:25:02 +0200
User-agent: Thunderbird 2.0.0.19 (X11/20081227)

Max Arnold wrote:
> On Sat, Mar 27, 2010 at 06:48:00PM +0100, Andreas Röhler wrote:
>>> My python-shell invoked via C-c C-c from python buffer can not print 
>>> unicode characters (emits
>>> UnicodeEncodeError) and sys.stdout.encoding is empty. System wide LANG set 
>>> to "ru_RU.UTF-8" and
>>> os.environ.get('LANG') in python shell confirms this.
>>>
>>> When python-shell invoked manually (M-x python-shell) there is no encoding 
>>> issues. Any ideas?
>>>
>> What you get from
>> C-h v buffer-file-coding-system?
> 
> ---
> buffer-file-coding-system is a variable defined in `C source code'.
> Its value is utf-8-unix
> Local in buffer test1.py; global value is utf-8-unix
> ...
> It does not apply to sending output to subprocesses, however.
> ---
> 
> Python module contains encoding specification # -*- coding: utf-8 -*- at the 
> beginning.
> Emacs version is 23.1.
> 
> 
> 

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?

You could try `py-execute-file' from python-mode.el

CC to mailing list there.


Andreas

--
https://code.launchpad.net/~a-roehler/python-mode
https://code.launchpad.net/s-x-emacs-werkstatt/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]