This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add unicode support to compile(), eval() and exec
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, jvr, lemburg, nnorwitz
Priority: normal Keywords: patch

Created on 2003-02-09 19:01 by jvr, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
unicode_eval.patch2 jvr, 2003-02-09 20:56 unicode support for compile, eval and exec
Messages (6)
msg42741 - (view) Author: Just van Rossum (jvr) * (Python triager) Date: 2003-02-09 19:01
Attached is a patch that adds "real" unicode support to compile(), eval() and exec. This is done by adding a new PyCompilerFlags flag called PyCF_SOURCE_IS_UTF8. Unicode strings are converted to utf-8 and this flag is set. I've added tests to test_builtin.py for compile and eval, but I don't know how/where to test exec.
msg42742 - (view) Author: Just van Rossum (jvr) * (Python triager) Date: 2003-02-09 20:56
Logged In: YES 
user_id=92689

Updated the patch for current CVS.

(Btw. if it were easy to obtain a utf-8 string with a bom mark, I think that should be preferable to adding the new compile flag. But it's not...)
msg42743 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-02-10 01:28
Logged In: YES 
user_id=6380

This is not a full review, but if this doesn't break any
unit tests, now is the time to check it in.
msg42744 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-02-10 03:06
Logged In: YES 
user_id=33168

The code which uses unicode APIs should probably be wrapped
with:

#ifdef Py_USING_UNICODE
 /* code */
#endif
msg42745 - (view) Author: Just van Rossum (jvr) * (Python triager) Date: 2003-02-10 08:28
Logged In: YES 
user_id=92689

Thanks, it's been checked in.
msg42746 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2003-02-10 09:25
Logged In: YES 
user_id=38388

I didn't see a mention in the Misc/NEWS file. It would
probably also
be a good idea to mention this in the docs for compile() et al.

Thanks for the work.
History
Date User Action Args
2022-04-10 16:06:40adminsetgithub: 37948
2003-02-09 19:01:53jvrcreate