[mod_python] import module via publisher

Bo Lorentsen bl at netgroup.dk
Tue Jun 19 11:27:40 EST 2001


richard hitier wrote:

> I'm a bit disapointed with the mod_python mechanisms of importing
> module.

I think there is a good explanation for mod_python to act like this.

> In fact, I'am still wondering how this could work:
>
> some times, whilst the
>  import my_module
> line is in, i get nameError or importError from the publisher .

I have the same problem, and I think it's because of a caching algorithm
somewhere (may in python ?)

> then, after reloading many times the url through the http client (here,
> w3m), I finally get my result ok.

Yeps, and sometimes the problem comes back, in the same session :-)

I think that when you request the same page several times it may spawn a
new process that makes it own python pre compile script cache, and
therefor takes in your newly updated code, and therefor works.

There must be an easy way to ether disable this cache of refresh it by
force (other than restarting apache) !

/BL




More information about the Mod_python mailing list