[Python-bugs-list] [Bug #110924] support Unicode for Python source code

noreply@sourceforge.net noreply@sourceforge.net
Fri, 8 Sep 2000 05:21:36 -0700

Bug #110924, was updated on 2000-Aug-02 08:17
Here is a current snapshot of the bug.

Project: Python
Category: Parser/Compiler
Status: Open
Resolution: None
Bug Group: Feature Request
Priority: 1
Summary: support Unicode for Python source code

Details: exec u"print 42"
doesn't work.


Date: 2000-Aug-09 02:35
By: effbot

python doesn't support 16-bit source code -- so what exactly do you want exec to do?

Date: 2000-Aug-17 05:17
By: none

That's exactly my point. Python should support Unicode
everywhere, in __str__ and __repr__, exec and eval, in open(), as a format for the source code (which would result in all variable names to be Unicode)...

Currenly working with Unicode (e.g. for XML) is a mess, because it's supported nowhere.

exec "a=''" seems to work and seems to treat the string as iso-8859-1 (or not at all)


Date: 2000-Sep-07 15:03
By: jhylton

Please do triage on this bug.

Date: 2000-Sep-08 05:21
By: lemburg

I don't think that the situation is that bad. You can't program
Python in Unicode, but this doesn't stop you from using it
in your Python programs.

Note that __str__ and __repr__ do support Unicode (it gets converted
to an 8-bit string using the default encoding).

There's currently not much need to have exec or eval() automatically
apply any conversion... you can always use str() around the argument
to make it support both 8-bit strings and Unicode.


For detailed info, follow this link: