[Python-Dev] Strange error importing a Pickle from 2.7 to 3.2

M.-A. Lemburg mal at egenix.com
Wed Feb 23 22:23:29 CET 2011


Alexander Belopolsky wrote:
> On Wed, Feb 23, 2011 at 4:07 PM, Guido van Rossum <guido at python.org> wrote:
>> I'm guessing that one of these encoding names is recognized by the C
>> code while the other one takes the slow path via the aliasing code.
> 
> This is absolutely right.  In fact I am going to propose adding
> strcmp(lower, "latin1") to the following test in
> PyUnicode_AsEncodedString():
> 
> 
> 	else if ((strcmp(lower, "latin-1") == 0) ||
>                  (strcmp(lower, "iso-8859-1") == 0))
>             return PyUnicode_EncodeLatin1(...
> 
> I'll open a separate issue for that.  In Python's own stdlib and tests
> "latin1" is a more common spelling than "latin-1", so it makes sense
> to optimize it.

"Latin-1" is the official name and the one used internally by Python,
so it would be good to have the test suite and Python code in general
to use that variant of the name (just as "utf-8" is preferred over
"utf8").

Instead of adding more aliases to the C code, please change the
encoding names in the stdlib and test suite.

Thanks,
-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Feb 23 2011)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.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/


More information about the Python-Dev mailing list