[Python-Dev] Weird error handling in os._execvpe

Zack Weinberg zack@codesourcery.com
Thu, 1 Aug 2002 22:24:33 -0700


On Thu, Aug 01, 2002 at 03:27:43PM -0400, Guido van Rossum wrote:

> ... I don't recall exactly why we ended up in this situation in the
> first place.  It's possible that it's an unnecessary sacrifice of a
> dead chicken, but it's also possible that there are platforms where
> this addressed a real need.  I'd like to think that it was because I
> didn't want to add more cruft to posixmodule.c (I've long given up
> on that :-).

I found out why it's done the way it is: There is no execvpe() in C,
not even in the extended-to-hell-and-back GNU libc.  I considered
dinking around with the C-level environ pointer so that execvp() would
do what we want, but this seems unreliable at best, given how many
different ways to access the environment there are.

So I think we're back to option 2 (enumerate the possible errors for
each platform).  ENOENT and ENOTDIR should cover it for Unix.  Would
other platform maintainers care to comment, please?

zw