[issue1288615] Python code.interact() and UTF-8 locale

2008-08-10 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

@kmtracey: Great and thanks! Three years later, the bug is finally 
fixed :-)

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1288615] Python code.interact() and UTF-8 locale

2008-08-07 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Le jeudi 07 août 2008 à 18:52 +, Karen Tracey a écrit :
> Karen Tracey <[EMAIL PROTECTED]> added the comment:
> 
> Cool, thanks! Do I take it from the Versions setting that the fix will
> be available in the next 2.6 beta but not get propagated to prior
> releases?  (I'm not very familiar with this issue tracker so am just
> trying to understand what the various fields mean.)

Indeed, the fix will be present in the next 2.6 beta.

As for the 2.5 branch, it is in maintenance mode and we want to minimize
the amount the potential breakage that we might cause there. I don't
think the present bug is important enough to warrant a backport, but
other developers may disagree and fix 2.5 as well :-)

(as for 3.0, it is unaffected)

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1288615] Python code.interact() and UTF-8 locale

2008-08-07 Thread Karen Tracey

Karen Tracey <[EMAIL PROTECTED]> added the comment:

Cool, thanks! Do I take it from the Versions setting that the fix will
be available in the next 2.6 beta but not get propagated to prior
releases?  (I'm not very familiar with this issue tracker so am just
trying to understand what the various fields mean.)

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1288615] Python code.interact() and UTF-8 locale

2008-08-07 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Fixed in r65578.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1288615] Python code.interact() and UTF-8 locale

2008-08-07 Thread Antoine Pitrou

Changes by Antoine Pitrou <[EMAIL PROTECTED]>:


--
keywords: +patch
nosy: +pitrou
type:  -> behavior
versions:  -Python 2.3, Python 2.4, Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1288615] Python code.interact() and UTF-8 locale

2008-08-06 Thread Karen Tracey

Karen Tracey <[EMAIL PROTECTED]> added the comment:

FWIW I also tried the fix on a Windows box with Python 2.5.1.  The
failure there is different since the Windows command prompt apparently
uses cp437 as its encoding:

Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ustr = u'¿Cómo'
>>> ustr
u'\xbfC\xf3mo'
>>> print ustr
¿Cómo
>>> import code
>>> code.interact()
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> ustr = u'¿Cómo'
>>> print ustr
Traceback (most recent call last):
  File "", line 1, in 
  File "d:\bin\Python2.5.1\lib\encodings\cp437.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\xa8' in
position 0: character maps to 

Applying the patch resulted in correct behavior on Windows as well.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1288615] Python code.interact() and UTF-8 locale

2008-08-06 Thread Karen Tracey

Karen Tracey <[EMAIL PROTECTED]> added the comment:

I just stumbled on this bug, it is still a problem in 2.5 and 2.6.  I
tried the supplied patch on 2.6b2 and it works.  Before the patch:

Python 2.6b2 (r26b2:65082, Jul 18 2008, 13:36:54) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> ustr = u'¿Cómo'  
>>> print ustr
¿Cómo
>>> import code
>>> code.interact()
Python 2.6b2 (r26b2:65082, Jul 18 2008, 13:36:54) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> ustr = u'¿Cómo'  
>>> print ustr
¿Cómo

After the patch:

Python 2.6b2 (r26b2:65082, Jul 18 2008, 13:36:54) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> ustr = u'¿Cómo'
>>> print ustr
¿Cómo
>>> import code
>>> code.interact()
Python 2.6b2 (r26b2:65082, Jul 18 2008, 13:36:54) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> ustr = u'¿Cómo'
>>> print ustr
¿Cómo

I realize it's a pretty little problem, but it was quite puzzling to
track down, because naturally I wasn't doing that exactly but rather
using a tool that under the covers was using code.interact() and mostly
behaves just like a bare python prompt except it was mangling unicode
string literals.  Any chance the fix could get in the code base?  The
last comment makes it sound like the patch was missing at one point. 
It's there now.  Is there any concern about it breaking something?

--
nosy: +kmtracey
versions: +Python 2.4, Python 2.5, Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com