Update of /cvsroot/pywin32/pywin32/pyisapi/isapi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31859
Modified Files:
threaded_extension.py
Log Message:
ISAPI changes the C locale, and this screws Python 2.3 and earlier - reset it
Index: threaded_extension.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/pyisapi/isapi/threaded_extension.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** threaded_extension.py 4 Sep 2004 09:36:49 -0000 1.2
--- threaded_extension.py 9 Sep 2004 08:56:14 -0000 1.3
***************
*** 1,2 ****
--- 1,6 ----
+ """An ISAPI extension base class implemented using a thread-pool."""
+ # $Id$
+
+ import sys
from isapi import isapicon
import isapi.simple
***************
*** 7,10 ****
--- 11,23 ----
from pywintypes import OVERLAPPED
+ # Python 2.3 and earlier insists on "C" locale - if it isn't, subtle things
+ # break, such as floating point constants loaded from .pyc files.
+ # The threading module uses such floating-points as an argument to sleep(),
+ # resulting in extremely long sleeps when tiny intervals are specified.
+ # We can work around this by resetting the C locale before the import.
+ if sys.hexversion < 0x02040000:
+ import locale
+ locale.setlocale(locale.LC_NUMERIC, "C")
+
import threading
import traceback
|