[Zope-dev] Failing Zope 2.8 / Python 2.3 tests on your box

Tres Seaver tseaver at palladion.com
Fri Aug 29 12:20:48 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stefan H. Holek wrote:
> What I have found out now is that in my Python 2.3.6 encodings/ 
> __init__.py does not contain 'import aliases' at module level,  
> whereas the Python 2.4 lib has this import. The patch does this:
> 
> import encodings
> encodings._aliases = encoding.aliases.aliases
> 
> which does therefore not work in 2.3. So, now I am curious how your  
> Python 2.3 differs, and why you don't see the error locally :-)

On my system, the aliases get imported during a codec lookup for
'iso-8869-1':  not at Python startup, but early in the test run, while
finding tests.

- ------------------- %< ------------------------------
- --- encodings/__init__.py	2008-08-29 12:18:18.000000000 -0400
+++ encodings/__init__.py.debug	2008-08-29 12:18:13.000000000 -0400
@@ -83,6 +83,7 @@
         mod = __import__('encodings.' + modname,
                          globals(), locals(), _import_tail)
     except ImportError:
+        import pdb; pdb.set_trace()
         import aliases
         modname = (aliases.aliases.get(modname) or
                    aliases.aliases.get(modname.replace('.', '_')) or
@@ -125,6 +126,7 @@
     except AttributeError:
         pass
     else:
+        import pdb; pdb.set_trace()
         import aliases
         for alias in codecaliases:
             if not aliases.aliases.has_key(alias):
- ------------------- %< ------------------------------

At that point, 'aliases' is added to the module's globals.  Maybe this
doesn't happen for you because you have a different 'site.py' which
pre-establishes that codec?

At any rate, we should make the patch harder against this case.


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIuCHf+gerLs4ltQ4RAtMCAKC0fBvDBNoR0NC4qwGKM3Fvqo7SDgCfZXfQ
mKLNaD78vXiUTDCZVRb/+NQ=
=YxJH
-----END PGP SIGNATURE-----


More information about the Zope-Dev mailing list