Issue Details (XML | Word | Printable)

Key: MODPYTHON-82
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Nicolas Lehuen
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

mod_python.publisher cache will not work if threading not built into Python

Created: 15/Oct/05 11:42 AM   Updated: 05/Mar/06 02:31 PM
Return to search
Component/s: publisher
Affects Version/s: 3.2.7
Fix Version/s: 3.2.7

Time Tracking:
Not Specified

Environment: Python --without-threads

Resolution Date: 15/Oct/05 05:03 PM


 Description  « Hide
The mod_python.cache module will not work if threads are not built into Python.

Mod_python error: "PythonHandler mod_python.publisher"

Traceback (most recent call last):

  File "/home/grahamd/testing/lib/python2.3/site-packages/mod_python/apache.py", line 287, in HandlerDispatch
    log=debug)

  File "/home/grahamd/testing/lib/python2.3/site-packages/mod_python/apache.py", line 461, in import_module
    module = imp.load_module(mname, f, p, d)

  File "/home/grahamd/testing/lib/python2.3/site-packages/mod_python/publisher.py", line 50, in ?
    from cache import ModuleCache, NOT_INITIALIZED

  File "/home/grahamd/testing/lib/python2.3/site-packages/mod_python/cache.py", line 23, in ?
    from threading import Lock

  File "/home/grahamd/testing/lib/python2.3/threading.py", line 6, in ?
    import thread

ImportError: No module named thread

Instead of the code:

from threading import Lock

It should use:

try:
  from threading import Lock
except:
  class Lock:
    def acquire(self): pass
    def release(self): pass


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #321309 Sat Oct 15 08:01:29 UTC 2005 nlehuen Fix for MODPYTHON-82.
Files Changed
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/cache.py
MODIFY /httpd/mod_python/trunk/src/include/mpversion.h

Repository Revision Date User Message
ASF #327638 Sat Oct 22 06:42:29 UTC 2005 nlehuen - better fix for MODPYTHON-82 (using dummy_threading instead of reimplementing Lock)
- fix for MODPYTHON-83
Files Changed
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/cache.py
MODIFY /httpd/mod_python/trunk/src/mod_python.c
MODIFY /httpd/mod_python/trunk/src/include/mpversion.h