[Zope] Zope, setlocale(), requests and traversal

Dieter Maurer dieter at handshake.de
Sun Dec 17 03:43:19 EST 2006


Doyon, Jean-Francois wrote at 2006-12-15 08:38 -0500:
>setlocale() is a python thing.  It wraps a C library, and that function
>setups an application wide environment (A bit like an environment
>variable would ...) ... Which is why it's not thread safe.

If you do not have a thread aware implementation of "setlocale", then
it is *VERY* dangerous to change "setlocale" inside a thread -- as
changing any global data can lead to non-deterministic behaviour in
a multi-threaded environment unless special precautions (locking) are
taken.


Apparently, you are aware of the danger. But, I have not seen
how you avoid the problem in your sketched solution.

-- 
Dieter


More information about the Zope mailing list