[mod_python] Same name, different directories...

Gregory (Grisha) Trubetskoy grisha at modpython.org
Thu Apr 4 15:06:37 EST 2002


Well, import_module has been rewritten (it's in CVS, the branch-2-7-7
branch), but if I understood Javier correctly, he is using same module
names in different directories on the same virtual server, i.e. within the
same sub-interpreter. Since Python keeps track of modules by their name,
not the full path, in this case the namesake modules will definitely be at
conflict with one another.

Grisha

On Thu, 4 Apr 2002, Jeff Stearns wrote:

> This is probably a bug in import_module() in apache.py.  There are several
> bugs in this function, and they show up in different ways sepending on how
> you set PythonAutoReload and whether you use the publisher module.
>
> I have tried various workarounds, but each workaround seems to expose a
> different problem with this code.
>
> Using unique names for each file is one thing that helps to reduce your
> exposure to these bugs.  Turning on PythonAutoReload can help in some cases.
>
> But rewriting import_module is probably what's really needed here.
>
> -jeff stearns
>
>
> ----- Original Message -----
> From: "Javier Quinteros" <jquinte at fadu.uba.ar>
> To: <mod_python at modpython.org>
> Sent: Thursday, April 04, 2002 10:28 AM
> Subject: [mod_python] Same name, different directories...
>
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi !!!
> > I've defined three Directories in my http.conf, all of them with python
> > scripts inside. What i've noticed is that if I have more than one module
> > called "module1.py" in different directories, mod_python is not able to
> work
> > with both of them. It seems that it loads the first one (it doesn't matter
> > which one) and after that, if I call the second one is the first one the
> one
> > who answers me. After that I had to rename some modules just to avoid the
> > possibility that mod_python use them the way he wants.
> >
> > Is there any solution? I mean, I don't want to get one interpreter for
> each
> > Directory I define.
> >
> > Thanks in advance,
> >
> > - --
> > - ---------------------------------
> > Javier Quinteros
> > jquinte at fadu.uba.ar
> > SecretarМa de PlanificaciСn
> > Universidad de Buenos Aires
> > - ---------------------------------
> > Existe un solo lugar donde el Norte y el Sur del mundo se enfrentan en
> > igualdad de condiciones: es una cancha de fЗtbol de Brasil, en la
> > desembocadura
> > del rМo Amazonas. La lМnea del ecuador corta por la mitad el estadio
> Zerao, en
> > AmapА, de modo que cada equipo juega un tiempo en el sur y otro tiempo en
> el
> > norte.
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.0.6 (GNU/Linux)
> > Comment: For info see http://www.gnupg.org
> >
> > iD8DBQE8rJtQdBzRnlFl4cgRAnPsAKDC1Q7KTH7QGL8XxdEPqvY9Zwud5gCfZHe0
> > sAcXkDQlrdfyrQvaq5rmuPc=
> > =qwm3
> > -----END PGP SIGNATURE-----
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://www.modpython.org/mailman/listinfo/mod_python
> >
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
>




More information about the Mod_python mailing list