[Zope] regex vs ts_regex
Brian Lloyd
brian@digicool.com
Mon, 11 Dec 2000 10:36:49 -0500
> Apropos http://www.zope.org/Documentation/How-To/ThreadSafety
>
> Am I missing something here?
> There seem to be a number of places in the current 2.2.4 source where
> the python regex module is used - not ts_regex, thus apparently
> violating your advice on thread safety?
>
> For example, I was just spelunking through
> /lib/python/AccessControl/User.py, App/Product.py so I started greping a
> few subdirectories.
>
> DateTime.py uses ts_regex as does OFS/ObjectManager.py but NOT
> OFS/SimpleItem.py ...
>
> Is there some reason why it's ok for some modules to use regex rather
> than ts_regex ???
It is safe to use it in certain cases where the thread
safety problems of the regex internals are not an issue.
I think Jim and some others who have used regex purposefully
have added a #TS comment to indicate that they have thought
through the threading issues before using it.
This will be moot in the future - one of the things
we'll _have_ to do to move to Python2.0 is become
SRE compliant.
Hope this helps!
Brian Lloyd brian@digicool.com
Software Engineer 540.371.6909
Digital Creations http://www.digicool.com