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: Max Arnold
Subject: Re: python mode shell and unicode
Date: Sun, 28 Mar 2010 23:37:08 +0700
User-agent: Mutt/1.5.20 (2009-06-14)

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 "<stdin>", line 1, in <module>
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.




reply via email to

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