bpo-32030: Fix Py_GetPath(): init program_name (#4665) · pythoncapi/cpython@9ac3d88 · GitHub
Skip to content

Commit 9ac3d88

Browse files
authored
bpo-32030: Fix Py_GetPath(): init program_name (python#4665)
* _PyMainInterpreterConfig_ReadEnv() now sets program_name from environment variables and pymain_parse_envvars() implements the falls back on argv[0]. * Remove _PyMain.program_name: use the program_name from _PyMainInterpreterConfig * Move the Py_SetProgramName() call back to pymain_init_python(), just before _Py_InitializeCore(). * pathconfig_global_init() now also calls _PyMainInterpreterConfig_Read() to set program_name if it isn't set yet * Cleanup PyCalculatePath: pass main_config to subfunctions to get directly fields from main_config (home, module_search_path_env and program_name)
1 parent b64de46 commit 9ac3d88

3 files changed

Lines changed: 124 additions & 102 deletions

File tree

Modules/getpath.c

Lines changed: 54 additions & 38 deletions

Modules/main.c

Lines changed: 32 additions & 37 deletions

0 commit comments

Comments
 (0)