◐ Shell
clean mode source ↗

bpo-34170: _PyCoreConfig_Read() leaves Py_IsolatedFlag unchanged by vstinner · Pull Request #8361 · python/cpython

Expand Up @@ -553,8 +553,7 @@ get_program_full_path(const _PyCoreConfig *core_config,

static int read_pth_file(_PyPathConfig *config, wchar_t *prefix, const wchar_t *path, int *isolated, int *nosite) read_pth_file(_PyPathConfig *config, wchar_t *prefix, const wchar_t *path) { FILE *sp_file = _Py_wfopen(path, L"r"); if (sp_file == NULL) { Expand All @@ -563,8 +562,8 @@ read_pth_file(_PyPathConfig *config, wchar_t *prefix, const wchar_t *path,
wcscpy_s(prefix, MAXPATHLEN+1, path); reduce(prefix); *isolated = 1; *nosite = 1; config->isolated = 1; config->no_site_import = 1;
size_t bufsiz = MAXPATHLEN; size_t prefixlen = wcslen(prefix); Expand All @@ -589,9 +588,10 @@ read_pth_file(_PyPathConfig *config, wchar_t *prefix, const wchar_t *path, }
if (strcmp(line, "import site") == 0) { *nosite = 0; config->no_site_import = 0; continue; } else if (strncmp(line, "import ", 7) == 0) { } else if (strncmp(line, "import ", 7) == 0) { Py_FatalError("only 'import site' is supported in ._pth file"); }
Expand Down Expand Up @@ -680,11 +680,7 @@ calculate_pth_file(_PyPathConfig *config, wchar_t *prefix) return 0; }
/* FIXME, bpo-32030: Global configuration variables should not be modified here, _PyPathConfig_Init() is called early in Python initialization: see pymain_cmdline(). */ return read_pth_file(config, prefix, spbuffer, &Py_IsolatedFlag, &Py_NoSiteFlag); return read_pth_file(config, prefix, spbuffer); }

Expand Down