CGIHTTPserver looze PYTHONPATH

vincent_delft vincent_delft at yahoo.com
Sun Jul 13 14:07:26 EDT 2003


vincent delft wrote:

I've found the problem by analysing the CGIHTTPServer.py code.

The exec command send the LOCAL env variable instead of the full
environemnts.

+ os.execve(scriptfile, args, os.environ)
- os.execve(scriptfile, args, env)







> I'm using Python 2.2.2
> the standard cgihttpserver (example given in the python doc).
> All HTML and CGI work.
> 
> BUT
> 
> by writing a simple python-cgi script like this :
> "
> #!/usr/bin/env python
> import os
> print "<html>%s</html>" % os.environ
> "
> I've discover that the environement variable are lost.
> For example PYTHONPATH is no more present.
> 
> Can you explain me why ?
> Does this is a bug ?
> How can I keep my PYTHONPATH variable across my python-cgi ?
> (I don't want to add os.putenv on top of each python-cgi script)
> 
> Thanks





More information about the Python-list mailing list