diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-10-31-22-53-32.gh-issue-98790.wUAmIZ.rst b/Misc/NEWS.d/next/Core and Builtins/2022-10-31-22-53-32.gh-issue-98790.wUAmIZ.rst new file mode 100644 index 00000000000000..3ad4a935b1358d --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-10-31-22-53-32.gh-issue-98790.wUAmIZ.rst @@ -0,0 +1,2 @@ +Disables path configuration warnings unless verbose mode (``-v`` +or ``PyConfig.verbose``) is enabled. diff --git a/Modules/getpath.c b/Modules/getpath.c index ceacf36d8968a1..402d7f7246877e 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -904,7 +904,7 @@ _PyConfig_InitPathConfig(PyConfig *config, int compute_path_config) !library_to_dict(dict, "library") || !wchar_to_dict(dict, "executable_dir", NULL) || !wchar_to_dict(dict, "py_setpath", _PyPathConfig_GetGlobalModuleSearchPath()) || - !funcs_to_dict(dict, config->pathconfig_warnings) || + !funcs_to_dict(dict, config->pathconfig_warnings && config->verbose) || #ifndef MS_WINDOWS PyDict_SetItemString(dict, "winreg", Py_None) < 0 || #endif