]> granicus.if.org Git - python/commitdiff
Patch #1009075, bug #952953: allow execve with empty 2nd argument
authorArmin Rigo <arigo@tunes.org>
Mon, 27 Sep 2004 19:54:33 +0000 (19:54 +0000)
committerArmin Rigo <arigo@tunes.org>
Mon, 27 Sep 2004 19:54:33 +0000 (19:54 +0000)
Doc/lib/libos.tex
Modules/posixmodule.c

index 88e64022b7f15aea6eddb70c6ecb8a076113722a..510da178745421784ec84106b4ceb2684d1f1146 100644 (file)
@@ -1226,8 +1226,8 @@ the individual parameters simply become additional parameters to the
 \function{execl*()} functions.  The \character{v} variants are good
 when the number of parameters is variable, with the arguments being
 passed in a list or tuple as the \var{args} parameter.  In either
-case, the arguments to the child process must start with the name of
-the command being run.
+case, the arguments to the child process should start with the name of
+the command being run, but this is not enforced.
 
 The variants which include a \character{p} near the end
 (\function{execlp()}, \function{execlpe()}, \function{execvp()},
index 306bce55abd3b88265c9ccffd9ab5a197d653418..764fa4c483741dfefe9afd70ca7824e3c9eaffe4 100644 (file)
@@ -2171,12 +2171,6 @@ posix_execv(PyObject *self, PyObject *args)
                return NULL;
        }
 
-       if (argc == 0) {
-               PyErr_SetString(PyExc_ValueError, "execv() arg 2 must not be empty");
-                PyMem_Free(path);
-               return NULL;
-       }
-
        argvlist = PyMem_NEW(char *, argc+1);
        if (argvlist == NULL) {
                PyMem_Free(path);
@@ -2253,12 +2247,6 @@ posix_execve(PyObject *self, PyObject *args)
                goto fail_0;
        }
 
-       if (argc == 0) {
-               PyErr_SetString(PyExc_ValueError,
-                               "execve() arg 2 must not be empty");
-               goto fail_0;
-       }
-
        argvlist = PyMem_NEW(char *, argc+1);
        if (argvlist == NULL) {
                PyErr_NoMemory();