Amaury Forgeot d'Arc <amaur...@gmail.com> added the comment:

I feel uneasy to change the default unicode-escape encoding.
I think that we mix two features here; to transfer a unicode string between two 
points, programs must agree on where the data ends, and how characters are 
represented as bytes.
All codecs including unicode-escape only dealt with byte conversion; 
(unicode-escape converts everything to printable 7bit ascii);
these patches want to add a feature related to the "where does the string end" 
issue, and is only aimed at "python code" containers. Other transports and 
protocols may choose different delimiters.

My point is that unicode-escape used to not change printable 7-bit ascii 
characters, and the patches will change this.

And actually this will break existing code. It did not take me long to find two 
examples of programs which embed unicode_escape-encoded text between quotes, 
and take care themselves of escaping quotes. First example generates javascript 
code, the second generates SQL statements:
http://github.com/chriseppstein/pywebmvc/blob/master/src/code/pywebmvc/tools/searchtool.py#L450
http://gitweb.sabayon.org/?p=entropy.git;a=blob;f=libraries/entropy/db/__init__.py;h=2d818455efa347f35b2e96d787fefd338055d066;hb=HEAD#l6463

This does not prevent the creation of a new codec, let's call it 
'python-unicode-escape' [ or 'repr' :-) ]

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7615>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to