[Python-checkins] bpo-20443: Fix calculate_program_full_path() warning (GH-14446)

Victor Stinner webhook-mailer at python.org
Fri Jun 28 10:49:42 EDT 2019


https://github.com/python/cpython/commit/3029035ef34c9bae0c8d965290cd9b273c8de1ea
commit: 3029035ef34c9bae0c8d965290cd9b273c8de1ea
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-06-28T16:49:38+02:00
summary:

bpo-20443: Fix calculate_program_full_path() warning (GH-14446)

Don't call _Py_isabs() with a bytes string (char*), the function
expects as wide string.

files:
M Modules/getpath.c

diff --git a/Modules/getpath.c b/Modules/getpath.c
index 751c0b79e8fa..4ddb6638fa85 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -761,7 +761,7 @@ calculate_program_full_path(const PyConfig *config,
       * absolutize() should help us out below
       */
     else if(0 == _NSGetExecutablePath(execpath, &nsexeclength) &&
-            _Py_isabs(execpath))
+            (wchar_t)execpath[0] == SEP)
     {
         size_t len;
         wchar_t *path = Py_DecodeLocale(execpath, &len);



More information about the Python-checkins mailing list