From 583a6bdc50260aaff359f61b8e872fde8b372a68 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Tue, 14 Jun 2022 19:05:42 -0700 Subject: [PATCH 1/2] Add note on relative path for os.exec* --- Doc/library/os.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 87e9eb6b69c84ba..c5bc7365f2d4fb4 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3653,7 +3653,8 @@ to be ignored. the :envvar:`PATH` variable. The other variants, :func:`execl`, :func:`execle`, :func:`execv`, and :func:`execve`, will not use the :envvar:`PATH` variable to locate the executable; *path* must contain an appropriate absolute or relative - path. + path. Note that even on Windows, the relative path in this case will follow the + Unix model, requiring ``./`` prepended to the executable. For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` (note that these all end in "e"), the *env* parameter must be a mapping which is From 46caa24f046a501acf7e491a538c354a9a966155 Mon Sep 17 00:00:00 2001 From: Stanley <46876382+slateny@users.noreply.github.com> Date: Sat, 22 Apr 2023 23:48:29 -0700 Subject: [PATCH 2/2] Update Doc/library/os.rst per review Co-authored-by: Steve Dower --- Doc/library/os.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index c5bc7365f2d4fb4..d50fed96629dbec 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3653,8 +3653,8 @@ to be ignored. the :envvar:`PATH` variable. The other variants, :func:`execl`, :func:`execle`, :func:`execv`, and :func:`execve`, will not use the :envvar:`PATH` variable to locate the executable; *path* must contain an appropriate absolute or relative - path. Note that even on Windows, the relative path in this case will follow the - Unix model, requiring ``./`` prepended to the executable. + path. Relative paths must include at least one slash, even on Windows, as + plain names will not be resolved. For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` (note that these all end in "e"), the *env* parameter must be a mapping which is