Re: Source encoding issues

2009-02-05 Thread Philip Jenvey


On Jan 31, 2009, at 4:24 PM, Damjan wrote:



 I know about the pep and how python source files are encoded, but the
 interactive shell is something completely different. I wonder on what
 local env variable does shell depend. Since I have all of them
 either sl_SI.UTF8 or en_GB.UTF-8.

 The Python interactive shell depends on the locale (LANG or LC_xxx,
 run locale to see).

 The paster shell is just buggy I'd say (same as ipython).

We have an issue open for this:

http://pylonshq.com/project/pylonshq/ticket/531

I just noticed that the problem is likely due to a bug in the stdlib's  
code module (see the ticket for more info) -- I'd love to see a monkey  
patch to solve this for paster shell. Any takers?

--
Philip Jenvey


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Source encoding issues

2009-01-31 Thread Damjan


 I know about the pep and how python source files are encoded, but the
 interactive shell is something completely different. I wonder on what
 local env variable does shell depend. Since I have all of them
 either sl_SI.UTF8 or en_GB.UTF-8.

The Python interactive shell depends on the locale (LANG or LC_xxx,
run locale to see).

The paster shell is just buggy I'd say (same as ipython).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Source encoding issues

2009-01-30 Thread Damjan

On Jan 30, 11:36 am, Domen Kožar ielect...@gmail.com wrote:
 I somewhat figured out that my u'strings' get encoded to latin, even
 though utf-8 is set as OS locale, vim encoding and python source
 encoding.

 After fiddling around, I got that far:http://paste.pocoo.org/show/101978/

 Any idea what could trigger such behaviour?

You need to put # -*- coding: utf-8 -*-
as one of the few first lines in your pytohn files. That way Python
knows what encoding your strings are written in. (there's a pep about
this too).

The interactive python interpreter behaves a little different since it
uses the locale when started and assumes strings are written in that
locales charset.

I guess the Pylons shell doesn't implement this same thing (ipython
has the same bug).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Source encoding issues

2009-01-30 Thread Domen Kožar

Hey.

I know about the pep and how python source files are encoded, but the
interactive shell is something completely different. I wonder on what
local env variable does shell depend. Since I have all of them
either sl_SI.UTF8 or en_GB.UTF-8.

On Jan 31, 1:39 am, Damjan gdam...@gmail.com wrote:
 On Jan 30, 11:36 am, Domen Kožar ielect...@gmail.com wrote:

  I somewhat figured out that my u'strings' get encoded to latin, even
  though utf-8 is set as OS locale, vim encoding and python source
  encoding.

  After fiddling around, I got that far:http://paste.pocoo.org/show/101978/

  Any idea what could trigger such behaviour?

 You need to put # -*- coding: utf-8 -*-
 as one of the few first lines in your pytohn files. That way Python
 knows what encoding your strings are written in. (there's a pep about
 this too).

 The interactive python interpreter behaves a little different since it
 uses the locale when started and assumes strings are written in that
 locales charset.

 I guess the Pylons shell doesn't implement this same thing (ipython
 has the same bug).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to 
pylons-discuss+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---