• Home
  • Raw
  • Download

Lines Matching refs:config

588 config_check_consistency(const PyConfig *config)  in config_check_consistency()  argument
591 assert(config->isolated >= 0); in config_check_consistency()
592 assert(config->use_environment >= 0); in config_check_consistency()
593 assert(config->dev_mode >= 0); in config_check_consistency()
594 assert(config->install_signal_handlers >= 0); in config_check_consistency()
595 assert(config->use_hash_seed >= 0); in config_check_consistency()
596 assert(config->hash_seed <= MAX_HASH_SEED); in config_check_consistency()
597 assert(config->faulthandler >= 0); in config_check_consistency()
598 assert(config->tracemalloc >= 0); in config_check_consistency()
599 assert(config->import_time >= 0); in config_check_consistency()
600 assert(config->show_ref_count >= 0); in config_check_consistency()
601 assert(config->dump_refs >= 0); in config_check_consistency()
602 assert(config->malloc_stats >= 0); in config_check_consistency()
603 assert(config->site_import >= 0); in config_check_consistency()
604 assert(config->bytes_warning >= 0); in config_check_consistency()
605 assert(config->warn_default_encoding >= 0); in config_check_consistency()
606 assert(config->inspect >= 0); in config_check_consistency()
607 assert(config->interactive >= 0); in config_check_consistency()
608 assert(config->optimization_level >= 0); in config_check_consistency()
609 assert(config->parser_debug >= 0); in config_check_consistency()
610 assert(config->write_bytecode >= 0); in config_check_consistency()
611 assert(config->verbose >= 0); in config_check_consistency()
612 assert(config->quiet >= 0); in config_check_consistency()
613 assert(config->user_site_directory >= 0); in config_check_consistency()
614 assert(config->parse_argv >= 0); in config_check_consistency()
615 assert(config->configure_c_stdio >= 0); in config_check_consistency()
616 assert(config->buffered_stdio >= 0); in config_check_consistency()
617 assert(config->program_name != NULL); in config_check_consistency()
618 assert(_PyWideStringList_CheckConsistency(&config->orig_argv)); in config_check_consistency()
619 assert(_PyWideStringList_CheckConsistency(&config->argv)); in config_check_consistency()
621 assert(config->argv.length >= 1); in config_check_consistency()
622 assert(_PyWideStringList_CheckConsistency(&config->xoptions)); in config_check_consistency()
623 assert(_PyWideStringList_CheckConsistency(&config->warnoptions)); in config_check_consistency()
624 assert(_PyWideStringList_CheckConsistency(&config->module_search_paths)); in config_check_consistency()
625 assert(config->module_search_paths_set >= 0); in config_check_consistency()
626 assert(config->platlibdir != NULL); in config_check_consistency()
627 assert(config->filesystem_encoding != NULL); in config_check_consistency()
628 assert(config->filesystem_errors != NULL); in config_check_consistency()
629 assert(config->stdio_encoding != NULL); in config_check_consistency()
630 assert(config->stdio_errors != NULL); in config_check_consistency()
632 assert(config->legacy_windows_stdio >= 0); in config_check_consistency()
635 assert(!(config->run_command != NULL && config->run_module != NULL)); in config_check_consistency()
636 assert(config->check_hash_pycs_mode != NULL); in config_check_consistency()
637 assert(config->_install_importlib >= 0); in config_check_consistency()
638 assert(config->pathconfig_warnings >= 0); in config_check_consistency()
646 PyConfig_Clear(PyConfig *config) in PyConfig_Clear() argument
654 CLEAR(config->pycache_prefix); in PyConfig_Clear()
655 CLEAR(config->pythonpath_env); in PyConfig_Clear()
656 CLEAR(config->home); in PyConfig_Clear()
657 CLEAR(config->program_name); in PyConfig_Clear()
659 _PyWideStringList_Clear(&config->argv); in PyConfig_Clear()
660 _PyWideStringList_Clear(&config->warnoptions); in PyConfig_Clear()
661 _PyWideStringList_Clear(&config->xoptions); in PyConfig_Clear()
662 _PyWideStringList_Clear(&config->module_search_paths); in PyConfig_Clear()
663 config->module_search_paths_set = 0; in PyConfig_Clear()
665 CLEAR(config->executable); in PyConfig_Clear()
666 CLEAR(config->base_executable); in PyConfig_Clear()
667 CLEAR(config->prefix); in PyConfig_Clear()
668 CLEAR(config->base_prefix); in PyConfig_Clear()
669 CLEAR(config->exec_prefix); in PyConfig_Clear()
670 CLEAR(config->base_exec_prefix); in PyConfig_Clear()
671 CLEAR(config->platlibdir); in PyConfig_Clear()
673 CLEAR(config->filesystem_encoding); in PyConfig_Clear()
674 CLEAR(config->filesystem_errors); in PyConfig_Clear()
675 CLEAR(config->stdio_encoding); in PyConfig_Clear()
676 CLEAR(config->stdio_errors); in PyConfig_Clear()
677 CLEAR(config->run_command); in PyConfig_Clear()
678 CLEAR(config->run_module); in PyConfig_Clear()
679 CLEAR(config->run_filename); in PyConfig_Clear()
680 CLEAR(config->check_hash_pycs_mode); in PyConfig_Clear()
682 _PyWideStringList_Clear(&config->orig_argv); in PyConfig_Clear()
688 _PyConfig_InitCompatConfig(PyConfig *config) in _PyConfig_InitCompatConfig() argument
690 memset(config, 0, sizeof(*config)); in _PyConfig_InitCompatConfig()
692 config->_config_init = (int)_PyConfig_INIT_COMPAT; in _PyConfig_InitCompatConfig()
693 config->isolated = -1; in _PyConfig_InitCompatConfig()
694 config->use_environment = -1; in _PyConfig_InitCompatConfig()
695 config->dev_mode = -1; in _PyConfig_InitCompatConfig()
696 config->install_signal_handlers = 1; in _PyConfig_InitCompatConfig()
697 config->use_hash_seed = -1; in _PyConfig_InitCompatConfig()
698 config->faulthandler = -1; in _PyConfig_InitCompatConfig()
699 config->tracemalloc = -1; in _PyConfig_InitCompatConfig()
700 config->module_search_paths_set = 0; in _PyConfig_InitCompatConfig()
701 config->parse_argv = 0; in _PyConfig_InitCompatConfig()
702 config->site_import = -1; in _PyConfig_InitCompatConfig()
703 config->bytes_warning = -1; in _PyConfig_InitCompatConfig()
704 config->warn_default_encoding = 0; in _PyConfig_InitCompatConfig()
705 config->inspect = -1; in _PyConfig_InitCompatConfig()
706 config->interactive = -1; in _PyConfig_InitCompatConfig()
707 config->optimization_level = -1; in _PyConfig_InitCompatConfig()
708 config->parser_debug= -1; in _PyConfig_InitCompatConfig()
709 config->write_bytecode = -1; in _PyConfig_InitCompatConfig()
710 config->verbose = -1; in _PyConfig_InitCompatConfig()
711 config->quiet = -1; in _PyConfig_InitCompatConfig()
712 config->user_site_directory = -1; in _PyConfig_InitCompatConfig()
713 config->configure_c_stdio = 0; in _PyConfig_InitCompatConfig()
714 config->buffered_stdio = -1; in _PyConfig_InitCompatConfig()
715 config->_install_importlib = 1; in _PyConfig_InitCompatConfig()
716 config->check_hash_pycs_mode = NULL; in _PyConfig_InitCompatConfig()
717 config->pathconfig_warnings = -1; in _PyConfig_InitCompatConfig()
718 config->_init_main = 1; in _PyConfig_InitCompatConfig()
719 config->_isolated_interpreter = 0; in _PyConfig_InitCompatConfig()
721 config->legacy_windows_stdio = -1; in _PyConfig_InitCompatConfig()
727 config_init_defaults(PyConfig *config) in config_init_defaults() argument
729 _PyConfig_InitCompatConfig(config); in config_init_defaults()
731 config->isolated = 0; in config_init_defaults()
732 config->use_environment = 1; in config_init_defaults()
733 config->site_import = 1; in config_init_defaults()
734 config->bytes_warning = 0; in config_init_defaults()
735 config->inspect = 0; in config_init_defaults()
736 config->interactive = 0; in config_init_defaults()
737 config->optimization_level = 0; in config_init_defaults()
738 config->parser_debug= 0; in config_init_defaults()
739 config->write_bytecode = 1; in config_init_defaults()
740 config->verbose = 0; in config_init_defaults()
741 config->quiet = 0; in config_init_defaults()
742 config->user_site_directory = 1; in config_init_defaults()
743 config->buffered_stdio = 1; in config_init_defaults()
744 config->pathconfig_warnings = 1; in config_init_defaults()
746 config->legacy_windows_stdio = 0; in config_init_defaults()
752 PyConfig_InitPythonConfig(PyConfig *config) in PyConfig_InitPythonConfig() argument
754 config_init_defaults(config); in PyConfig_InitPythonConfig()
756 config->_config_init = (int)_PyConfig_INIT_PYTHON; in PyConfig_InitPythonConfig()
757 config->configure_c_stdio = 1; in PyConfig_InitPythonConfig()
758 config->parse_argv = 1; in PyConfig_InitPythonConfig()
763 PyConfig_InitIsolatedConfig(PyConfig *config) in PyConfig_InitIsolatedConfig() argument
765 config_init_defaults(config); in PyConfig_InitIsolatedConfig()
767 config->_config_init = (int)_PyConfig_INIT_ISOLATED; in PyConfig_InitIsolatedConfig()
768 config->isolated = 1; in PyConfig_InitIsolatedConfig()
769 config->use_environment = 0; in PyConfig_InitIsolatedConfig()
770 config->user_site_directory = 0; in PyConfig_InitIsolatedConfig()
771 config->dev_mode = 0; in PyConfig_InitIsolatedConfig()
772 config->install_signal_handlers = 0; in PyConfig_InitIsolatedConfig()
773 config->use_hash_seed = 0; in PyConfig_InitIsolatedConfig()
774 config->faulthandler = 0; in PyConfig_InitIsolatedConfig()
775 config->tracemalloc = 0; in PyConfig_InitIsolatedConfig()
776 config->pathconfig_warnings = 0; in PyConfig_InitIsolatedConfig()
778 config->legacy_windows_stdio = 0; in PyConfig_InitIsolatedConfig()
785 PyConfig_SetString(PyConfig *config, wchar_t **config_str, const wchar_t *str) in PyConfig_SetString() argument
787 PyStatus status = _Py_PreInitializeFromConfig(config, NULL); in PyConfig_SetString()
809 config_set_bytes_string(PyConfig *config, wchar_t **config_str, in config_set_bytes_string() argument
812 PyStatus status = _Py_PreInitializeFromConfig(config, NULL); in config_set_bytes_string()
839 #define CONFIG_SET_BYTES_STR(config, config_str, str, NAME) \ argument
840 config_set_bytes_string(config, config_str, str, "cannot decode " NAME)
847 PyConfig_SetBytesString(PyConfig *config, wchar_t **config_str, in PyConfig_SetBytesString() argument
850 return CONFIG_SET_BYTES_STR(config, config_str, str, "string"); in PyConfig_SetBytesString()
855 _PyConfig_Copy(PyConfig *config, const PyConfig *config2) in _PyConfig_Copy() argument
859 PyConfig_Clear(config); in _PyConfig_Copy()
861 #define COPY_ATTR(ATTR) config->ATTR = config2->ATTR in _PyConfig_Copy()
864 status = PyConfig_SetString(config, &config->ATTR, config2->ATTR); \ in _PyConfig_Copy()
871 if (_PyWideStringList_Copy(&config->LIST, &config2->LIST) < 0) { \ in _PyConfig_Copy()
949 _PyConfig_AsDict(const PyConfig *config) in _PyConfig_AsDict() argument
969 SET_ITEM(#ATTR, PyLong_FromLong(config->ATTR)) in _PyConfig_AsDict()
971 SET_ITEM(#ATTR, PyLong_FromUnsignedLong(config->ATTR)) in _PyConfig_AsDict()
977 SET_ITEM(#ATTR, FROM_WSTRING(config->ATTR)) in _PyConfig_AsDict()
979 SET_ITEM(#LIST, _PyWideStringList_AsList(&config->LIST)) in _PyConfig_AsDict()
1128 config_dict_get_wstr(PyObject *dict, const char *name, PyConfig *config, in config_dict_get_wstr() argument
1137 status = PyConfig_SetString(config, result, NULL); in config_dict_get_wstr()
1148 status = PyConfig_SetString(config, result, wstr); in config_dict_get_wstr()
1160 config_dict_get_wstrlist(PyObject *dict, const char *name, PyConfig *config, in config_dict_get_wstrlist() argument
1211 _PyConfig_FromDict(PyConfig *config, PyObject *dict) in _PyConfig_FromDict() argument
1225 if (config_dict_get_int(dict, #KEY, &config->KEY) < 0) { \ in _PyConfig_FromDict()
1228 CHECK_VALUE(#KEY, config->KEY >= 0); \ in _PyConfig_FromDict()
1232 if (config_dict_get_wstr(dict, #KEY, config, &config->KEY) < 0) { \ in _PyConfig_FromDict()
1235 CHECK_VALUE(#KEY, config->KEY != NULL); \ in _PyConfig_FromDict()
1239 if (config_dict_get_wstr(dict, #KEY, config, &config->KEY) < 0) { \ in _PyConfig_FromDict()
1245 if (config_dict_get_wstrlist(dict, #KEY, config, &config->KEY) < 0) { \ in _PyConfig_FromDict()
1252 config->_config_init == _PyConfig_INIT_COMPAT in _PyConfig_FromDict()
1253 || config->_config_init == _PyConfig_INIT_PYTHON in _PyConfig_FromDict()
1254 || config->_config_init == _PyConfig_INIT_ISOLATED); in _PyConfig_FromDict()
1260 if (config_dict_get_ulong(dict, "hash_seed", &config->hash_seed) < 0) { in _PyConfig_FromDict()
1263 CHECK_VALUE("hash_seed", config->hash_seed <= MAX_HASH_SEED); in _PyConfig_FromDict()
1332 config_get_env(const PyConfig *config, const char *name) in config_get_env() argument
1334 return _Py_GetEnv(config->use_environment, name); in config_get_env()
1342 config_get_env_dup(PyConfig *config, in config_get_env_dup() argument
1348 assert(config->use_environment >= 0); in config_get_env_dup()
1350 if (!config->use_environment) { in config_get_env_dup()
1362 return PyConfig_SetString(config, dest, var); in config_get_env_dup()
1370 return config_set_bytes_string(config, dest, var, decode_err_msg); in config_get_env_dup()
1380 config_get_global_vars(PyConfig *config) in config_get_global_vars() argument
1382 if (config->_config_init != _PyConfig_INIT_COMPAT) { in config_get_global_vars()
1388 if (config->ATTR == -1) { \ in config_get_global_vars()
1389 config->ATTR = VALUE; \ in config_get_global_vars()
1392 if (config->ATTR == -1) { \ in config_get_global_vars()
1393 config->ATTR = !(VALUE); \ in config_get_global_vars()
1422 config_set_global_vars(const PyConfig *config) in config_set_global_vars() argument
1425 if (config->ATTR != -1) { \ in config_set_global_vars()
1426 VAR = config->ATTR; \ in config_set_global_vars()
1429 if (config->ATTR != -1) { \ in config_set_global_vars()
1430 VAR = !config->ATTR; \ in config_set_global_vars()
1453 Py_HashRandomizationFlag = (config->use_hash_seed == 0 || in config_set_global_vars()
1454 config->hash_seed != 0); in config_set_global_vars()
1464 config_init_program_name(PyConfig *config) in config_init_program_name() argument
1471 config->program_name = _PyMem_RawWcsdup(program_name); in config_init_program_name()
1472 if (config->program_name == NULL) { in config_init_program_name()
1488 const char *p = config_get_env(config, "PYTHONEXECUTABLE"); in config_init_program_name()
1490 status = CONFIG_SET_BYTES_STR(config, &config->program_name, p, in config_init_program_name()
1504 status = CONFIG_SET_BYTES_STR(config, in config_init_program_name()
1505 &config->program_name, in config_init_program_name()
1529 const PyWideStringList *argv = &config->argv; in config_init_program_name()
1531 config->program_name = _PyMem_RawWcsdup(argv->items[0]); in config_init_program_name()
1532 if (config->program_name == NULL) { in config_init_program_name()
1544 status = PyConfig_SetString(config, &config->program_name, in config_init_program_name()
1553 config_init_executable(PyConfig *config) in config_init_executable() argument
1555 assert(config->executable == NULL); in config_init_executable()
1560 PyStatus status = PyConfig_SetString(config, in config_init_executable()
1561 &config->executable, in config_init_executable()
1573 config_get_xoption(const PyConfig *config, wchar_t *name) in config_get_xoption() argument
1575 return _Py_get_xoption(&config->xoptions, name); in config_get_xoption()
1580 config_init_home(PyConfig *config) in config_init_home() argument
1582 assert(config->home == NULL); in config_init_home()
1587 PyStatus status = PyConfig_SetString(config, &config->home, home); in config_init_home()
1594 return CONFIG_GET_ENV_DUP(config, &config->home, in config_init_home()
1599 config_init_hash_seed(PyConfig *config) in config_init_hash_seed() argument
1601 const char *seed_text = config_get_env(config, "PYTHONHASHSEED"); in config_init_hash_seed()
1618 config->use_hash_seed = 1; in config_init_hash_seed()
1619 config->hash_seed = seed; in config_init_hash_seed()
1623 config->use_hash_seed = 0; in config_init_hash_seed()
1624 config->hash_seed = 0; in config_init_hash_seed()
1649 config_read_env_vars(PyConfig *config) in config_read_env_vars() argument
1652 int use_env = config->use_environment; in config_read_env_vars()
1655 _Py_get_env_flag(use_env, &config->parser_debug, "PYTHONDEBUG"); in config_read_env_vars()
1656 _Py_get_env_flag(use_env, &config->verbose, "PYTHONVERBOSE"); in config_read_env_vars()
1657 _Py_get_env_flag(use_env, &config->optimization_level, "PYTHONOPTIMIZE"); in config_read_env_vars()
1658 _Py_get_env_flag(use_env, &config->inspect, "PYTHONINSPECT"); in config_read_env_vars()
1663 config->write_bytecode = 0; in config_read_env_vars()
1669 config->user_site_directory = 0; in config_read_env_vars()
1675 config->buffered_stdio = 0; in config_read_env_vars()
1679 _Py_get_env_flag(use_env, &config->legacy_windows_stdio, in config_read_env_vars()
1683 if (config_get_env(config, "PYTHONDUMPREFS")) { in config_read_env_vars()
1684 config->dump_refs = 1; in config_read_env_vars()
1686 if (config_get_env(config, "PYTHONMALLOCSTATS")) { in config_read_env_vars()
1687 config->malloc_stats = 1; in config_read_env_vars()
1690 if (config->pythonpath_env == NULL) { in config_read_env_vars()
1691 status = CONFIG_GET_ENV_DUP(config, &config->pythonpath_env, in config_read_env_vars()
1698 if(config->platlibdir == NULL) { in config_read_env_vars()
1699 status = CONFIG_GET_ENV_DUP(config, &config->platlibdir, in config_read_env_vars()
1706 if (config->use_hash_seed < 0) { in config_read_env_vars()
1707 status = config_init_hash_seed(config); in config_read_env_vars()
1718 config_init_tracemalloc(PyConfig *config) in config_init_tracemalloc() argument
1723 const char *env = config_get_env(config, "PYTHONTRACEMALLOC"); in config_init_tracemalloc()
1734 config->tracemalloc = nframe; in config_init_tracemalloc()
1737 const wchar_t *xoption = config_get_xoption(config, L"tracemalloc"); in config_init_tracemalloc()
1756 config->tracemalloc = nframe; in config_init_tracemalloc()
1763 config_init_pycache_prefix(PyConfig *config) in config_init_pycache_prefix() argument
1765 assert(config->pycache_prefix == NULL); in config_init_pycache_prefix()
1767 const wchar_t *xoption = config_get_xoption(config, L"pycache_prefix"); in config_init_pycache_prefix()
1771 config->pycache_prefix = _PyMem_RawWcsdup(sep + 1); in config_init_pycache_prefix()
1772 if (config->pycache_prefix == NULL) { in config_init_pycache_prefix()
1779 config->pycache_prefix = NULL; in config_init_pycache_prefix()
1784 return CONFIG_GET_ENV_DUP(config, &config->pycache_prefix, in config_init_pycache_prefix()
1791 config_read_complex_options(PyConfig *config) in config_read_complex_options() argument
1794 if (config->faulthandler < 0) { in config_read_complex_options()
1795 if (config_get_env(config, "PYTHONFAULTHANDLER") in config_read_complex_options()
1796 || config_get_xoption(config, L"faulthandler")) { in config_read_complex_options()
1797 config->faulthandler = 1; in config_read_complex_options()
1800 if (config_get_env(config, "PYTHONPROFILEIMPORTTIME") in config_read_complex_options()
1801 || config_get_xoption(config, L"importtime")) { in config_read_complex_options()
1802 config->import_time = 1; in config_read_complex_options()
1806 if (config->tracemalloc < 0) { in config_read_complex_options()
1807 status = config_init_tracemalloc(config); in config_read_complex_options()
1813 if (config->pycache_prefix == NULL) { in config_read_complex_options()
1814 status = config_init_pycache_prefix(config); in config_read_complex_options()
1857 config_get_locale_encoding(PyConfig *config, const PyPreConfig *preconfig, in config_get_locale_encoding() argument
1864 PyStatus status = PyConfig_SetString(config, locale_encoding, encoding); in config_get_locale_encoding()
1871 config_init_stdio_encoding(PyConfig *config, in config_init_stdio_encoding() argument
1878 if (config->stdio_encoding == NULL && _Py_StandardStreamEncoding != NULL) { in config_init_stdio_encoding()
1879 status = CONFIG_SET_BYTES_STR(config, &config->stdio_encoding, in config_init_stdio_encoding()
1887 if (config->stdio_errors == NULL && _Py_StandardStreamErrors != NULL) { in config_init_stdio_encoding()
1888 status = CONFIG_SET_BYTES_STR(config, &config->stdio_errors, in config_init_stdio_encoding()
1897 if (config->stdio_encoding != NULL && config->stdio_errors != NULL) { in config_init_stdio_encoding()
1902 const char *opt = config_get_env(config, "PYTHONIOENCODING"); in config_init_stdio_encoding()
1920 if (config->stdio_encoding == NULL) { in config_init_stdio_encoding()
1921 status = CONFIG_SET_BYTES_STR(config, &config->stdio_encoding, in config_init_stdio_encoding()
1939 if (config->stdio_errors == NULL && errors != NULL) { in config_init_stdio_encoding()
1940 status = CONFIG_SET_BYTES_STR(config, &config->stdio_errors, in config_init_stdio_encoding()
1953 if (config->stdio_encoding == NULL) { in config_init_stdio_encoding()
1954 status = config_get_locale_encoding(config, preconfig, in config_init_stdio_encoding()
1955 &config->stdio_encoding); in config_init_stdio_encoding()
1960 if (config->stdio_errors == NULL) { in config_init_stdio_encoding()
1964 status = PyConfig_SetString(config, &config->stdio_errors, errors); in config_init_stdio_encoding()
1976 config_get_fs_encoding(PyConfig *config, const PyPreConfig *preconfig, in config_get_fs_encoding() argument
1980 return PyConfig_SetString(config, fs_encoding, L"utf-8"); in config_get_fs_encoding()
1991 return PyConfig_SetString(config, fs_encoding, encoding); in config_get_fs_encoding()
1994 return PyConfig_SetString(config, fs_encoding, L"utf-8"); in config_get_fs_encoding()
1998 return PyConfig_SetString(config, fs_encoding, L"ascii"); in config_get_fs_encoding()
2001 return config_get_locale_encoding(config, preconfig, fs_encoding); in config_get_fs_encoding()
2007 config_init_fs_encoding(PyConfig *config, const PyPreConfig *preconfig) in config_init_fs_encoding() argument
2011 if (config->filesystem_encoding == NULL) { in config_init_fs_encoding()
2012 status = config_get_fs_encoding(config, preconfig, in config_init_fs_encoding()
2013 &config->filesystem_encoding); in config_init_fs_encoding()
2019 if (config->filesystem_errors == NULL) { in config_init_fs_encoding()
2031 status = PyConfig_SetString(config, &config->filesystem_errors, errors); in config_init_fs_encoding()
2041 config_read(PyConfig *config, int compute_path_config) in config_read() argument
2046 if (config->use_environment) { in config_read()
2047 status = config_read_env_vars(config); in config_read()
2054 if (config_get_xoption(config, L"showrefcount")) { in config_read()
2055 config->show_ref_count = 1; in config_read()
2058 status = config_read_complex_options(config); in config_read()
2063 if (config->home == NULL) { in config_read()
2064 status = config_init_home(config); in config_read()
2070 if (config->executable == NULL) { in config_read()
2071 status = config_init_executable(config); in config_read()
2077 if(config->platlibdir == NULL) { in config_read()
2078 status = CONFIG_SET_BYTES_STR(config, &config->platlibdir, PLATLIBDIR, in config_read()
2085 if (config->_install_importlib) { in config_read()
2086 status = _PyConfig_InitPathConfig(config, compute_path_config); in config_read()
2093 if (config->dev_mode) { in config_read()
2094 if (config->faulthandler < 0) { in config_read()
2095 config->faulthandler = 1; in config_read()
2098 if (config->faulthandler < 0) { in config_read()
2099 config->faulthandler = 0; in config_read()
2101 if (config->tracemalloc < 0) { in config_read()
2102 config->tracemalloc = 0; in config_read()
2104 if (config->use_hash_seed < 0) { in config_read()
2105 config->use_hash_seed = 0; in config_read()
2106 config->hash_seed = 0; in config_read()
2109 if (config->filesystem_encoding == NULL || config->filesystem_errors == NULL) { in config_read()
2110 status = config_init_fs_encoding(config, preconfig); in config_read()
2116 status = config_init_stdio_encoding(config, preconfig); in config_read()
2121 if (config->argv.length < 1) { in config_read()
2123 status = PyWideStringList_Append(&config->argv, L""); in config_read()
2129 if (config->check_hash_pycs_mode == NULL) { in config_read()
2130 status = PyConfig_SetString(config, &config->check_hash_pycs_mode, in config_read()
2137 if (config->configure_c_stdio < 0) { in config_read()
2138 config->configure_c_stdio = 1; in config_read()
2142 if (config->parse_argv == 1) { in config_read()
2143 config->parse_argv = 2; in config_read()
2151 config_init_stdio(const PyConfig *config) in config_init_stdio() argument
2160 if (!config->buffered_stdio) { in config_init_stdio()
2171 else if (config->interactive) { in config_init_stdio()
2192 _PyConfig_Write(const PyConfig *config, _PyRuntimeState *runtime) in _PyConfig_Write() argument
2194 config_set_global_vars(config); in _PyConfig_Write()
2196 if (config->configure_c_stdio) { in _PyConfig_Write()
2197 config_init_stdio(config); in _PyConfig_Write()
2202 preconfig->isolated = config->isolated; in _PyConfig_Write()
2203 preconfig->use_environment = config->use_environment; in _PyConfig_Write()
2204 preconfig->dev_mode = config->dev_mode; in _PyConfig_Write()
2206 if (_Py_SetArgcArgv(config->orig_argv.length, in _PyConfig_Write()
2207 config->orig_argv.items) < 0) in _PyConfig_Write()
2238 config_parse_cmdline(PyConfig *config, PyWideStringList *warnoptions, in config_parse_cmdline() argument
2242 const PyWideStringList *argv = &config->argv; in config_parse_cmdline()
2244 const wchar_t* program = config->program_name; in config_parse_cmdline()
2255 if (config->run_command == NULL) { in config_parse_cmdline()
2267 config->run_command = command; in config_parse_cmdline()
2276 if (config->run_module == NULL) { in config_parse_cmdline()
2277 config->run_module = _PyMem_RawWcsdup(_PyOS_optarg); in config_parse_cmdline()
2278 if (config->run_module == NULL) { in config_parse_cmdline()
2293 status = PyConfig_SetString(config, &config->check_hash_pycs_mode, in config_parse_cmdline()
2307 config->bytes_warning++; in config_parse_cmdline()
2311 config->parser_debug++; in config_parse_cmdline()
2315 config->inspect++; in config_parse_cmdline()
2316 config->interactive++; in config_parse_cmdline()
2328 config->optimization_level++; in config_parse_cmdline()
2332 config->write_bytecode = 0; in config_parse_cmdline()
2336 config->user_site_directory = 0; in config_parse_cmdline()
2340 config->site_import = 0; in config_parse_cmdline()
2348 config->buffered_stdio = 0; in config_parse_cmdline()
2352 config->verbose++; in config_parse_cmdline()
2356 config->skip_source_first_line = 1; in config_parse_cmdline()
2376 config->quiet++; in config_parse_cmdline()
2380 config->use_hash_seed = 0; in config_parse_cmdline()
2398 if (config->run_command == NULL && config->run_module == NULL in config_parse_cmdline()
2401 && config->run_filename == NULL) in config_parse_cmdline()
2403 config->run_filename = _PyMem_RawWcsdup(argv->items[_PyOS_optind]); in config_parse_cmdline()
2404 if (config->run_filename == NULL) { in config_parse_cmdline()
2409 if (config->run_command != NULL || config->run_module != NULL) { in config_parse_cmdline()
2428 config_init_env_warnoptions(PyConfig *config, PyWideStringList *warnoptions) in config_init_env_warnoptions() argument
2433 status = CONFIG_GET_ENV_DUP(config, &env, in config_init_env_warnoptions()
2462 warnoptions_append(PyConfig *config, PyWideStringList *options, in warnoptions_append() argument
2469 if (_PyWideStringList_Find(&config->warnoptions, option)) { in warnoptions_append()
2482 warnoptions_extend(PyConfig *config, PyWideStringList *options, in warnoptions_extend() argument
2489 PyStatus status = warnoptions_append(config, options, items[i]); in warnoptions_extend()
2499 config_init_warnoptions(PyConfig *config, in config_init_warnoptions() argument
2524 if (config->dev_mode) { in config_init_warnoptions()
2525 status = warnoptions_append(config, &options, L"default"); in config_init_warnoptions()
2531 status = warnoptions_extend(config, &options, env_warnoptions); in config_init_warnoptions()
2536 status = warnoptions_extend(config, &options, cmdline_warnoptions); in config_init_warnoptions()
2545 if (config->bytes_warning) { in config_init_warnoptions()
2547 if (config->bytes_warning> 1) { in config_init_warnoptions()
2553 status = warnoptions_append(config, &options, filter); in config_init_warnoptions()
2559 status = warnoptions_extend(config, &options, sys_warnoptions); in config_init_warnoptions()
2565 status = _PyWideStringList_Extend(&options, &config->warnoptions); in config_init_warnoptions()
2570 _PyWideStringList_Clear(&config->warnoptions); in config_init_warnoptions()
2571 config->warnoptions = options; in config_init_warnoptions()
2581 config_update_argv(PyConfig *config, Py_ssize_t opt_index) in config_update_argv() argument
2583 const PyWideStringList *cmdline_argv = &config->argv; in config_update_argv()
2605 if (config->run_command != NULL) { in config_update_argv()
2609 else if (config->run_module != NULL) { in config_update_argv()
2625 _PyWideStringList_Clear(&config->argv); in config_update_argv()
2626 config->argv = config_argv; in config_update_argv()
2632 core_read_precmdline(PyConfig *config, _PyPreCmdline *precmdline) in core_read_precmdline() argument
2636 if (config->parse_argv == 1) { in core_read_precmdline()
2637 if (_PyWideStringList_Copy(&precmdline->argv, &config->argv) < 0) { in core_read_precmdline()
2649 _PyPreConfig_GetConfig(&preconfig, config); in core_read_precmdline()
2656 status = _PyPreCmdline_SetConfig(precmdline, config); in core_read_precmdline()
2666 config_run_filename_abspath(PyConfig *config) in config_run_filename_abspath() argument
2668 if (!config->run_filename) { in config_run_filename_abspath()
2673 if (_Py_isabs(config->run_filename)) { in config_run_filename_abspath()
2680 if (_Py_abspath(config->run_filename, &abs_filename) < 0) { in config_run_filename_abspath()
2689 PyMem_RawFree(config->run_filename); in config_run_filename_abspath()
2690 config->run_filename = abs_filename; in config_run_filename_abspath()
2696 config_read_cmdline(PyConfig *config) in config_read_cmdline() argument
2703 if (config->parse_argv < 0) { in config_read_cmdline()
2704 config->parse_argv = 1; in config_read_cmdline()
2707 if (config->program_name == NULL) { in config_read_cmdline()
2708 status = config_init_program_name(config); in config_read_cmdline()
2714 if (config->parse_argv == 1) { in config_read_cmdline()
2716 status = config_parse_cmdline(config, &cmdline_warnoptions, &opt_index); in config_read_cmdline()
2721 status = config_run_filename_abspath(config); in config_read_cmdline()
2726 status = config_update_argv(config, opt_index); in config_read_cmdline()
2732 status = config_run_filename_abspath(config); in config_read_cmdline()
2738 if (config->use_environment) { in config_read_cmdline()
2739 status = config_init_env_warnoptions(config, &env_warnoptions); in config_read_cmdline()
2751 status = config_init_warnoptions(config, in config_read_cmdline()
2770 _PyConfig_SetPyArgv(PyConfig *config, const _PyArgv *args) in _PyConfig_SetPyArgv() argument
2772 PyStatus status = _Py_PreInitializeFromConfig(config, args); in _PyConfig_SetPyArgv()
2777 return _PyArgv_AsWstrList(args, &config->argv); in _PyConfig_SetPyArgv()
2784 PyConfig_SetBytesArgv(PyConfig *config, Py_ssize_t argc, char * const *argv) in PyConfig_SetBytesArgv() argument
2791 return _PyConfig_SetPyArgv(config, &args); in PyConfig_SetBytesArgv()
2796 PyConfig_SetArgv(PyConfig *config, Py_ssize_t argc, wchar_t * const *argv) in PyConfig_SetArgv() argument
2803 return _PyConfig_SetPyArgv(config, &args); in PyConfig_SetArgv()
2808 PyConfig_SetWideStringList(PyConfig *config, PyWideStringList *list, in PyConfig_SetWideStringList() argument
2811 PyStatus status = _Py_PreInitializeFromConfig(config, NULL); in PyConfig_SetWideStringList()
2832 _PyConfig_Read(PyConfig *config, int compute_path_config) in _PyConfig_Read() argument
2836 status = _Py_PreInitializeFromConfig(config, NULL); in _PyConfig_Read()
2841 config_get_global_vars(config); in _PyConfig_Read()
2843 if (config->orig_argv.length == 0 in _PyConfig_Read()
2844 && !(config->argv.length == 1 in _PyConfig_Read()
2845 && wcscmp(config->argv.items[0], L"") == 0)) in _PyConfig_Read()
2847 if (_PyWideStringList_Copy(&config->orig_argv, &config->argv) < 0) { in _PyConfig_Read()
2853 status = core_read_precmdline(config, &precmdline); in _PyConfig_Read()
2858 assert(config->isolated >= 0); in _PyConfig_Read()
2859 if (config->isolated) { in _PyConfig_Read()
2860 config->use_environment = 0; in _PyConfig_Read()
2861 config->user_site_directory = 0; in _PyConfig_Read()
2864 status = config_read_cmdline(config); in _PyConfig_Read()
2870 status = _PySys_ReadPreinitXOptions(config); in _PyConfig_Read()
2875 status = config_read(config, compute_path_config); in _PyConfig_Read()
2880 assert(config_check_consistency(config)); in _PyConfig_Read()
2891 PyConfig_Read(PyConfig *config) in PyConfig_Read() argument
2893 return _PyConfig_Read(config, 1); in PyConfig_Read()
2931 const PyConfig *config = _PyInterpreterState_GetConfig(interp); in _Py_GetConfigsAsDict() local
2932 dict = _PyConfig_AsDict(config); in _Py_GetConfigsAsDict()
3004 init_dump_ascii_wstr(config->FIELD); \ in _Py_DumpPathConfig()
3008 const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); in _Py_DumpPathConfig() local
3012 PySys_WriteStderr(" isolated = %i\n", config->isolated); in _Py_DumpPathConfig()
3013 PySys_WriteStderr(" environment = %i\n", config->use_environment); in _Py_DumpPathConfig()
3014 PySys_WriteStderr(" user site = %i\n", config->user_site_directory); in _Py_DumpPathConfig()
3015 PySys_WriteStderr(" import site = %i\n", config->site_import); in _Py_DumpPathConfig()