On Feb 2, 2010, at 12:44 PM, Malcolm Greene wrote:
> The one area Python has disappointed me is with its locale module. For a
> single application, the locale module works fine, but it is not thread
> safe and thus can not be used with many Python web server frameworks.
>
> I have posted multiple times to the python mailing list asking how
> others are handling this issue, but have never received a reply.
>
> Do you guys have any suggestions? (My situation: A cherrypy based web
> server application where each session may want to operate with a
> different locale).
Locale works process-wide, not thread-wide. Setting it affects
everything in that process.
You could try using the multiprocessing module instead of threading;
I've never used it in the context of a web server, but it's worth a shot.
Otherwise, you'll have to implement some thread-level storage of locale values
and maintain it manually.
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.