execvpe weirdness

Nathan Gray n8gray at caltech.edu.is.my.e-mail.address
Wed Feb 21 05:43:40 CET 2001


Nathan Gray wrote:

> When I run the following script I get this error message:
> 
> Error: Cannot find images in /usr/local/bin
> Apparently, Webots is not properly installed
> You must set the environment variable _HOME to the
> location of the  directory and re-run .
> For example: export _HOME=/usr/local/
> or:          setenv _HOME /usr/local/
> This is the error you should get if WEBOTS_HOME is not set correctly, 
> but the error should complain about WEBOTS_HOME, not _HOME!
> 
> Can somebody tell me where I've gone wrong?
> 
> Thanks,
> -n8

OK, thanks to a dejanews search I figured out that I need to say:
	execvpe(execName, [execName], os.environ)
or
	execle(execName, execName, os.environ)

and I think I even understand why -- it's so you can call an executable 
with something other than the name of the executable as argv[0].  I can 
sorta see why this is useful, but it would be nice if the documentation 
for exec* was a little more explicit about the nature of "arg0".  A line 
like:  "Note:  arg0 is traditionally the name of the executable, and 
some executables will depend on this." would have saved me a lot of 
hair-pulling.

Or have I misunderstood something?

-n8

-- 
_.~'^`~._.~'^`~._.~'^`~._.~'^`~._.~'^`~._
               Nathaniel Gray
     California Institute of Technology
      Computation and Neural Systems
       n8gray <at> caltech <dot> edu
_.~'^`~._.~'^`~._.~'^`~._.~'^`~._.~'^`~._




More information about the Python-list mailing list