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.

Author lemburg
Recipients ezio.melotti, lemburg, r.david.murray, rhansen
Date 2010-01-07.21:23:42
SpamBayes Score 5.112577e-14
Marked as misclassified No
Message-id <4B4650DD.5080007@egenix.com>
In-reply-to <1262892640.75.0.383684829846.issue7615@psf.upfronthosting.co.za>
Content
Richard Hansen wrote:
> 
> Richard Hansen <rhansen@bbn.com> added the comment:
> 
>> Does the last patch obsolete the first two?  If so please delete the 
>> obsolete ones.
> 
> Yes and no -- it depends on what the core Python developers want and are comfortable with:
>   * unicode_escape_single_quotes.patch:  Only escapes single quotes, simple patch.
>   * unicode_escape_single_and_double_quotes:  Superset of the above (also escapes double quotes), but probably unnecessary.  Still a relatively simple patch.
>   * unicode_escape_reorg.patch:  Superset of unicode_escape_single_quotes.patch that also fixes raw_unicode_escape and other small issues.  It's a bigger patch with a greater potential for backwards-compatibility issues.  (Pickle is an example:  It implemented its own workaround to address raw_unicode_escape's broken escaping, so fixing raw_unicode_escape ended up breaking pickle.  The reorg patch removes pickle's workaround, but there will probably be similar workarounds in other existing code.)
> 
> My preference is to have unicode_escape_reorg.patch committed, but I'm not sure how conservative the core developers are.  The release of Python 2.7 is approaching, and they may not want to take on the risk right now.  If that's the case, I'd be happy with applying unicode_escape_single_quotes.patch for now and moving unicode_escape_reorg.patch to a new issue report.

We'll need a patch that implements single and double quote escaping for
unicode_escape and a \uXXXX style escaping of quotes for the raw_unicode_escape
encoder.

Other changes are not necessary. The pickle copy of the codec can be
left untouched (both cPickle.c and pickle.py) - it doesn't matter
whether quotes are escaped or not in the pickle data stream.

It's only important that the decoders can reliably decode the
additional escapes (which AFAIK, they do automatically anyway).

>> I imagine there are might be small doc updates required, as well.
> 
> Certainly Misc/NEWS will need to be patched.  I'm unfamiliar with what else the devs might want for documentation, so I'd love to get some additional guidance.  I would also appreciate additional feedback on the technical merits of the reorg patch before investing too much time on updating documentation.

Misc/NEWS needs an entry which makes the changes clear.

The codecs' encode direction is not defined anywhere in the
documentation, AFAIK, and basically an implementation detail.
The codecs were originally only meant for Python's internal
use to decode Python literal byte strings into Unicode.
In PEP 100, I only defined the decoding direction. The
main idea was to have a set of codecs which read and produce
Latin-1 compatible text - Python 2.x used to accept Latin-1
Unicode literals without source code encoding marker.

>> I haven't looked at the patch itself, but concerning your test 
>> patch:  your try/except style is unnecessary, I think.  Better to 
>> just let the syntax error bubble up on its own.
> 
> OK, I'll make that change.  I added the try/except as an attempt to convert a known ERROR to a FAIL in case that was important for some reason.

I'll have to have a look at the patch itself as well. No time for
that now, perhaps tomorrow.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
History
Date User Action Args
2010-01-07 21:23:46lemburgsetrecipients: + lemburg, ezio.melotti, r.david.murray, rhansen
2010-01-07 21:23:44lemburglinkissue7615 messages
2010-01-07 21:23:42lemburgcreate