[mod_python] Severe problems with importing still happening.

Byron Ellacott bje at apnic.net
Tue Aug 31 12:19:46 EDT 2004

Sean Reifschneider wrote:
>    http://www.modpython.org/pipermail/mod_python/2003-June/013807.html

The trouble with submodules not appearing is to do with how mod_python's 
import_module method works.  When it imports foo.bar, it creates an 
entry in sys.modules[] for foo, and for foo.bar, but does not put the 
bar attribute on sys.modules['foo'].  This means that when you try to 
"from foo import bar" python will see that foo.bar exists in 
sys.modules, and try to return the bar attribute of sys.modules['foo'].

I wrote a patch to import_module to fix this problem, which might help you:


As far as I know, it's not been incorporated into mod_python's CVS.


More information about the Mod_python mailing list