The relevant bug reports you want to read and obviously educate the
comp.lang.python people about are:

http://bugs.python.org/issue8098
http://bugs.python.org/issue9260

It is a sad fact that on many Python related forums there is a growing
number of people who think they know stuff and actually know crap all.

All the problems derive from a stupid function in Python internals
called PyImport_ImportModuleNoBlock(). It was designed to avoid lockups of
the import machinery but just causes other problems because a module import
can fail if the import lock is held by a different thread. This faulty
magic fairy dust was sprinkled on the time.strptime() function which
internally loads _strptime module. If you access time.strptime() when
another thread holds the import lock, the call will fail because of a
failed import. All very silly.

Graham


On 28 December 2012 01:33, Gnarlodious <[email protected]> wrote:

> To fix this, I had to add
>
> import _strptime
>
> to my *.wsgi script. This apparently is somehow related to threadlocking.
>
> Unanswered questions, which the comp.lang.python group roundly riidiculed
> me for asking:
>
> 1) Why is the only error reported a cryptic "AttributeError: 'module'
> object has no attribute '_strptime' "?
>
> 2) Why is it time.time() functions normally while time.strptime() errors?
>
> 3) Why does this error occur in mod_wsgi and not interactive mode?
>
> After this mess, I am not sure Python handles threaded processing very
> robustly. It seems like an embarrassing problem Python people prefer to not
> discuss. Let the user beware, Python 3.1.3 seems to be the last version
> where threadlocking is not drastically enforced.
>
> -- Gnarlie
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/Pj8lEds7Q4cJ.
>
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to