stlib name clash when using python as ASP language

Joost JoostMoesker at gmail.com
Sun Feb 4 07:53:22 EST 2007


> You *assume* that [0] is the IIS path, but perhaps some other imported
> module changed sys.path too, and now it's not the first one anymore.
> If you know exactly the path, try sys.path.remove(iis_path).
>
> --
> Gabriel Genellina

It's was a hack and definitely not meant to go in to production ;)
Since gzip.py lives in python24\lib I thought setting sys.path[0] to
python24\lib would load this load this module, no matter what.
However, in some magically way the sys.path gets modified during the
request by IIS. Maybe IIS resets the global sys.path per new request,
causing sporadic problems when request are handled concurrently? I
just don't know. The iis/inetsrv path is included in sys.path for a
reason and I don't want to fiddle around with sys.path to create
problems in other parts of the code. I was wandering if there is some
way to prevent a  name clashes by using a custom importer or something
like that.




More information about the Python-list mailing list