[ZPatterns] Zope 2.4b1 and ZPatterns 0.4.3, bug and fix

Ty Sarna [email protected]
Tue, 26 Jun 2001 10:55:49 -0400


Thanks for the patches... Phillip has been working on 2.3.x compat and
2.4 hasn't really been on our radar too much. (We've been quite behind
in tracking Zope... Our apps are still on 2.2.x!)

> Besides this error, there're some warnings:
> 
> /home/jdavid/Zope-2.4.0b1/lib/python/ts_regex.py:87: DeprecationWarning: the 
> regex module is deprecated; please use the re module
>   import regex, regsub #, Sync
> /home/jdavid/Zope-2.4.0b1/lib/python2.1/regsub.py:15: DeprecationWarning: the
>  regsub module is deprecated; please use re.sub()
>   DeprecationWarning)

This is from PlugIns's replaceability support.  I don't know if this is
even needed anymore, but assuming it is: It looks like in 2.4 one should
just use the "re" module.  I guess that re is thread-safe and that there
is no ts_re or equivalent in 2.4. 

It looks like you could just replace:

# XXX Replaceability support - temporary until Zope supports it natively
import ts_regex
bad_id=ts_regex.compile('[^a-zA-Z0-9-_~\,\. ]').search #TS

with:

# XXX Replaceability support - temporary until Zope supports it natively
import re
bad_id=re.compile('[^a-zA-Z0-9-_~\,\. ]').search

and then change:

        if bad_id(id) != -1:
	    ...

to:

	if bad_id(id) is not None:
	    ...

> 2001-06-26T08:51:13 PROBLEM(100) Init Ambiguous name for method of Products.P
> lugIns.PlugIns.PlugInGroup: "manage_workspace" != "manage_main"
> WARNING: Python C API version mismatch for module DynPersist:
>   This Python has API version 1010, module DynPersist has version 1007.

You need to compile a new DynPersist against Python 2.1. The Python C
API changed from 1.5.x to 2.0 and from 2.0 to 2.1. C modules that aren't
recompiled for the correct python version may crash or do wierd things...

Speaking of which, does anyone have a kjbuckets that is updated to work
correctly with Python 2.1?