From c472fb6b2744b36c7a0823c20e0d5ac9be3ea623 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 23 Jun 2017 15:21:24 +0200 Subject: [PATCH] bpo-30602: Fix lastarg in os.spawnve() (#2287) (#2357) Fix a regression introduced by myself in the commit 526b22657cb18fe79118c2ea68511aca09430c2c. (cherry picked from commit c8d6ab2e25ff212702d387e516e258b1d8c52910) --- Modules/posixmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 0a9123b61b..11aaeef02b 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5189,7 +5189,7 @@ os_spawnve_impl(PyObject *module, int mode, path_t *path, PyObject *argv, goto fail_1; } if (i == 0 && !argvlist[0][0]) { - lastarg = i; + lastarg = i + 1; PyErr_SetString( PyExc_ValueError, "spawnv() arg 2 first element cannot be empty"); -- 2.50.0