Lines Matching full:config
49 static void config_set_string(PyConfig *config, wchar_t **config_str, const wchar_t *str) in config_set_string() argument
51 PyStatus status = PyConfig_SetString(config, config_str, str); in config_set_string()
53 PyConfig_Clear(config); in config_set_string()
59 static void config_set_program_name(PyConfig *config) in config_set_program_name() argument
62 config_set_string(config, &config->program_name, program_name); in config_set_program_name()
66 static void init_from_config_clear(PyConfig *config) in init_from_config_clear() argument
68 PyStatus status = Py_InitializeFromConfig(config); in init_from_config_clear()
69 PyConfig_Clear(config); in init_from_config_clear()
78 PyConfig config; in _testembed_Py_InitializeFromConfig() local
79 _PyConfig_InitCompatConfig(&config); in _testembed_Py_InitializeFromConfig()
80 config_set_program_name(&config); in _testembed_Py_InitializeFromConfig()
81 init_from_config_clear(&config); in _testembed_Py_InitializeFromConfig()
449 static void config_set_argv(PyConfig *config, Py_ssize_t argc, wchar_t * const *argv) in config_set_argv() argument
451 PyStatus status = PyConfig_SetArgv(config, argc, argv); in config_set_argv()
453 PyConfig_Clear(config); in config_set_argv()
460 config_set_wide_string_list(PyConfig *config, PyWideStringList *list, in config_set_wide_string_list() argument
463 PyStatus status = PyConfig_SetWideStringList(config, list, length, items); in config_set_wide_string_list()
465 PyConfig_Clear(config); in config_set_wide_string_list()
485 PyConfig config; in check_init_compat_config() local
486 _PyConfig_InitCompatConfig(&config); in check_init_compat_config()
488 config_set_program_name(&config); in check_init_compat_config()
489 init_from_config_clear(&config); in check_init_compat_config()
575 PyConfig config; in test_init_from_config() local
576 _PyConfig_InitCompatConfig(&config); in test_init_from_config()
578 config.install_signal_handlers = 0; in test_init_from_config()
583 config.use_hash_seed = 1; in test_init_from_config()
584 config.hash_seed = 123; in test_init_from_config()
589 config.faulthandler = 1; in test_init_from_config()
592 config.tracemalloc = 2; in test_init_from_config()
595 config.import_time = 1; in test_init_from_config()
598 config.code_debug_ranges = 0; in test_init_from_config()
600 config.show_ref_count = 1; in test_init_from_config()
604 config.malloc_stats = 1; in test_init_from_config()
607 config_set_string(&config, &config.pycache_prefix, L"conf_pycache_prefix"); in test_init_from_config()
610 config_set_string(&config, &config.program_name, L"./conf_program_name"); in test_init_from_config()
622 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_init_from_config()
623 config.parse_argv = 1; in test_init_from_config()
630 config_set_wide_string_list(&config, &config.xoptions, in test_init_from_config()
636 config_set_wide_string_list(&config, &config.warnoptions, in test_init_from_config()
641 /* FIXME: test path config: module_search_path .. dll_path */ in test_init_from_config()
644 status = PyConfig_SetBytesString(&config, &config.platlibdir, "my_platlibdir"); in test_init_from_config()
646 PyConfig_Clear(&config); in test_init_from_config()
652 config.verbose = 1; in test_init_from_config()
655 config.site_import = 0; in test_init_from_config()
658 config.bytes_warning = 1; in test_init_from_config()
662 config.inspect = 1; in test_init_from_config()
665 config.interactive = 1; in test_init_from_config()
669 config.optimization_level = 2; in test_init_from_config()
675 config.write_bytecode = 0; in test_init_from_config()
678 config.quiet = 1; in test_init_from_config()
680 config.configure_c_stdio = 1; in test_init_from_config()
684 config.buffered_stdio = 0; in test_init_from_config()
690 Force it to 0 through the config. */ in test_init_from_config()
691 config.legacy_windows_stdio = 0; in test_init_from_config()
693 config_set_string(&config, &config.stdio_encoding, L"iso8859-1"); in test_init_from_config()
694 config_set_string(&config, &config.stdio_errors, L"replace"); in test_init_from_config()
698 config.user_site_directory = 0; in test_init_from_config()
700 config_set_string(&config, &config.check_hash_pycs_mode, L"always"); in test_init_from_config()
703 config.pathconfig_warnings = 0; in test_init_from_config()
705 config.safe_path = 1; in test_init_from_config()
707 config._isolated_interpreter = 1; in test_init_from_config()
709 init_from_config_clear(&config); in test_init_from_config()
719 PyConfig config; in check_init_parse_argv() local
720 PyConfig_InitPythonConfig(&config); in check_init_parse_argv()
722 config.parse_argv = parse_argv; in check_init_parse_argv()
733 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in check_init_parse_argv()
734 init_from_config_clear(&config); in check_init_parse_argv()
802 PyConfig config; in test_init_python_env() local
803 PyConfig_InitPythonConfig(&config); in test_init_python_env()
805 config_set_program_name(&config); in test_init_python_env()
806 init_from_config_clear(&config); in test_init_python_env()
850 PyConfig config; in test_init_isolated_flag() local
851 PyConfig_InitPythonConfig(&config); in test_init_isolated_flag()
854 config.isolated = 1; in test_init_isolated_flag()
856 config.safe_path = 0; in test_init_isolated_flag()
857 config.use_environment = 1; in test_init_isolated_flag()
858 config.user_site_directory = 1; in test_init_isolated_flag()
860 config_set_program_name(&config); in test_init_isolated_flag()
862 init_from_config_clear(&config); in test_init_isolated_flag()
883 PyConfig config; in test_preinit_isolated1() local
884 _PyConfig_InitCompatConfig(&config); in test_preinit_isolated1()
886 config_set_program_name(&config); in test_preinit_isolated1()
888 init_from_config_clear(&config); in test_preinit_isolated1()
910 PyConfig config; in test_preinit_isolated2() local
911 _PyConfig_InitCompatConfig(&config); in test_preinit_isolated2()
914 config.isolated = 1; in test_preinit_isolated2()
916 config_set_program_name(&config); in test_preinit_isolated2()
918 init_from_config_clear(&config); in test_preinit_isolated2()
947 PyConfig config; in test_preinit_dont_parse_argv() local
948 PyConfig_InitIsolatedConfig(&config); in test_preinit_dont_parse_argv()
950 config.isolated = 0; in test_preinit_dont_parse_argv()
954 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_preinit_dont_parse_argv()
955 config_set_program_name(&config); in test_preinit_dont_parse_argv()
956 init_from_config_clear(&config); in test_preinit_dont_parse_argv()
966 PyConfig config; in test_preinit_parse_argv() local
967 PyConfig_InitPythonConfig(&config); in test_preinit_parse_argv()
972 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_preinit_parse_argv()
973 config_set_program_name(&config); in test_preinit_parse_argv()
974 init_from_config_clear(&config); in test_preinit_parse_argv()
1031 PyConfig config; in check_preinit_isolated_config() local
1032 PyConfig_InitIsolatedConfig(&config); in check_preinit_isolated_config()
1034 config_set_program_name(&config); in check_preinit_isolated_config()
1035 init_from_config_clear(&config); in check_preinit_isolated_config()
1084 PyConfig config; in check_init_python_config() local
1085 PyConfig_InitPythonConfig(&config); in check_init_python_config()
1087 config_set_program_name(&config); in check_init_python_config()
1088 init_from_config_clear(&config); in check_init_python_config()
1122 PyConfig config; in test_init_dont_configure_locale() local
1123 PyConfig_InitPythonConfig(&config); in test_init_dont_configure_locale()
1125 config_set_program_name(&config); in test_init_dont_configure_locale()
1126 init_from_config_clear(&config); in test_init_dont_configure_locale()
1136 PyConfig config; in test_init_dev_mode() local
1137 PyConfig_InitPythonConfig(&config); in test_init_dev_mode()
1141 config.dev_mode = 1; in test_init_dev_mode()
1142 config_set_program_name(&config); in test_init_dev_mode()
1143 init_from_config_clear(&config); in test_init_dev_mode()
1364 PyConfig config; in run_audit_run_test() local
1365 PyConfig_InitPythonConfig(&config); in run_audit_run_test()
1367 config.argv.length = argc; in run_audit_run_test()
1368 config.argv.items = argv; in run_audit_run_test()
1369 config.parse_argv = 1; in run_audit_run_test()
1370 config.program_name = argv[0]; in run_audit_run_test()
1371 config.interactive = 1; in run_audit_run_test()
1372 config.isolated = 0; in run_audit_run_test()
1373 config.use_environment = 1; in run_audit_run_test()
1374 config.quiet = 1; in run_audit_run_test()
1378 PyStatus status = Py_InitializeFromConfig(&config); in run_audit_run_test()
1410 PyConfig config; in test_init_read_set() local
1411 PyConfig_InitPythonConfig(&config); in test_init_read_set()
1413 status = PyConfig_SetBytesString(&config, &config.program_name, in test_init_read_set()
1419 status = PyConfig_Read(&config); in test_init_read_set()
1424 status = PyWideStringList_Insert(&config.module_search_paths, in test_init_read_set()
1430 status = PyWideStringList_Append(&config.module_search_paths, in test_init_read_set()
1437 config_set_string(&config, &config.executable, L"my_executable"); in test_init_read_set()
1438 init_from_config_clear(&config); in test_init_read_set()
1445 PyConfig_Clear(&config); in test_init_read_set()
1456 PyConfig config; in test_init_sys_add() local
1457 PyConfig_InitPythonConfig(&config); in test_init_sys_add()
1466 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_init_sys_add()
1467 config.parse_argv = 1; in test_init_sys_add()
1470 status = PyWideStringList_Append(&config.xoptions, in test_init_sys_add()
1476 status = PyWideStringList_Append(&config.warnoptions, in test_init_sys_add()
1482 config_set_program_name(&config); in test_init_sys_add()
1483 init_from_config_clear(&config); in test_init_sys_add()
1490 PyConfig_Clear(&config); in test_init_sys_add()
1544 PyConfig config; in test_init_setpath_config() local
1545 PyConfig_InitPythonConfig(&config); in test_init_setpath_config()
1547 config_set_string(&config, &config.program_name, L"conf_program_name"); in test_init_setpath_config()
1548 config_set_string(&config, &config.executable, L"conf_executable"); in test_init_setpath_config()
1549 init_from_config_clear(&config); in test_init_setpath_config()
1595 PyConfig config; in test_init_is_python_build() local
1596 _PyConfig_InitCompatConfig(&config); in test_init_is_python_build()
1597 config_set_program_name(&config); in test_init_is_python_build()
1598 config_set_string(&config, &config.home, home); in test_init_is_python_build()
1604 config._is_python_build = INT_MAX; in test_init_is_python_build()
1607 config._is_python_build = INT_MIN; in test_init_is_python_build()
1609 init_from_config_clear(&config); in test_init_is_python_build()
1612 config._is_python_build = -1; in test_init_is_python_build()
1613 init_from_config_clear(&config); in test_init_is_python_build()
1627 PyConfig config; in test_init_warnoptions() local
1628 PyConfig_InitPythonConfig(&config); in test_init_warnoptions()
1630 config.dev_mode = 1; in test_init_warnoptions()
1631 config.bytes_warning = 1; in test_init_warnoptions()
1633 config_set_program_name(&config); in test_init_warnoptions()
1636 status = PyWideStringList_Append(&config.warnoptions, in test_init_warnoptions()
1646 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_init_warnoptions()
1647 config.parse_argv = 1; in test_init_warnoptions()
1649 status = PyConfig_Read(&config); in test_init_warnoptions()
1654 status = PyWideStringList_Append(&config.warnoptions, in test_init_warnoptions()
1660 status = PyWideStringList_Insert(&config.warnoptions, in test_init_warnoptions()
1666 init_from_config_clear(&config); in test_init_warnoptions()
1675 PyConfig config; in tune_config() local
1676 PyConfig_InitPythonConfig(&config); in tune_config()
1677 if (_PyInterpreterState_GetConfigCopy(&config) < 0) { in tune_config()
1678 PyConfig_Clear(&config); in tune_config()
1683 config.bytes_warning = 2; in tune_config()
1685 if (_PyInterpreterState_SetConfig(&config) < 0) { in tune_config()
1686 PyConfig_Clear(&config); in tune_config()
1689 PyConfig_Clear(&config); in tune_config()
1697 PyConfig config; in test_init_set_config() local
1698 PyConfig_InitIsolatedConfig(&config); in test_init_set_config()
1699 config_set_string(&config, &config.program_name, PROGRAM_NAME); in test_init_set_config()
1700 config._init_main = 0; in test_init_set_config()
1701 config.bytes_warning = 0; in test_init_set_config()
1702 init_from_config_clear(&config); in test_init_set_config()
1722 static void configure_init_main(PyConfig *config) in configure_init_main() argument
1730 config->parse_argv = 1; in configure_init_main()
1732 config_set_argv(config, Py_ARRAY_LENGTH(argv), argv); in configure_init_main()
1733 config_set_string(config, &config->program_name, L"./python3"); in configure_init_main()
1739 PyConfig config; in test_init_run_main() local
1740 PyConfig_InitPythonConfig(&config); in test_init_run_main()
1742 configure_init_main(&config); in test_init_run_main()
1743 init_from_config_clear(&config); in test_init_run_main()
1751 PyConfig config; in test_init_main() local
1752 PyConfig_InitPythonConfig(&config); in test_init_main()
1754 configure_init_main(&config); in test_init_main()
1755 config._init_main = 0; in test_init_main()
1756 init_from_config_clear(&config); in test_init_main()
1778 PyConfig config; in test_run_main() local
1779 PyConfig_InitPythonConfig(&config); in test_run_main()
1785 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_run_main()
1786 config_set_string(&config, &config.program_name, L"./python3"); in test_run_main()
1787 init_from_config_clear(&config); in test_run_main()
1809 PyConfig config; in test_get_argc_argv() local
1810 PyConfig_InitPythonConfig(&config); in test_get_argc_argv()
1813 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_get_argc_argv()
1814 config_set_string(&config, &config.program_name, L"./python3"); in test_get_argc_argv()
1818 PyStatus status = PyConfig_Read(&config); in test_get_argc_argv()
1820 PyConfig_Clear(&config); in test_get_argc_argv()
1824 init_from_config_clear(&config); in test_get_argc_argv()
1861 PyConfig config; in check_use_frozen_modules() local
1862 PyConfig_InitPythonConfig(&config); in check_use_frozen_modules()
1864 config.parse_argv = 1; in check_use_frozen_modules()
1873 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in check_use_frozen_modules()
1874 init_from_config_clear(&config); in check_use_frozen_modules()
1961 PyConfig config; in test_repeated_init_and_inittab() local
1962 PyConfig_InitPythonConfig(&config); in test_repeated_init_and_inittab()
1963 config.isolated = 1; in test_repeated_init_and_inittab()
1964 config_set_argv(&config, Py_ARRAY_LENGTH(argv), argv); in test_repeated_init_and_inittab()
1965 init_from_config_clear(&config); in test_repeated_init_and_inittab()