# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001 Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: # oon arfiandwi , 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-05-09 14:19+0000\n" "PO-Revision-Date: 2021-06-28 00:49+0000\n" "Last-Translator: oon arfiandwi , 2025\n" "Language-Team: Indonesian (https://app.transifex.com/python-doc/teams/5390/id/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: id\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/init_config.rst:7 msgid "Python Initialization Configuration" msgstr "" #: ../../c-api/init_config.rst:13 msgid "PyInitConfig C API" msgstr "" #: ../../c-api/init_config.rst:17 msgid "Python can be initialized with :c:func:`Py_InitializeFromInitConfig`." msgstr "" #: ../../c-api/init_config.rst:19 ../../c-api/init_config.rst:650 msgid "" "The :c:func:`Py_RunMain` function can be used to write a customized Python " "program." msgstr "" #: ../../c-api/init_config.rst:22 ../../c-api/init_config.rst:653 msgid "" "See also :ref:`Initialization, Finalization, and Threads `." msgstr "" #: ../../c-api/init_config.rst:25 msgid ":pep:`741` \"Python Configuration C API\"." msgstr "" #: ../../c-api/init_config.rst:29 ../../c-api/init_config.rst:660 msgid "Example" msgstr "Contoh" #: ../../c-api/init_config.rst:31 msgid "" "Example of customized Python always running with the :ref:`Python " "Development Mode ` enabled; return ``-1`` on error:" msgstr "" #: ../../c-api/init_config.rst:34 msgid "" "int init_python(void)\n" "{\n" " PyInitConfig *config = PyInitConfig_Create();\n" " if (config == NULL) {\n" " printf(\"PYTHON INIT ERROR: memory allocation failed\\n\");\n" " return -1;\n" " }\n" "\n" " // Enable the Python Development Mode\n" " if (PyInitConfig_SetInt(config, \"dev_mode\", 1) < 0) {\n" " goto error;\n" " }\n" "\n" " // Initialize Python with the configuration\n" " if (Py_InitializeFromInitConfig(config) < 0) {\n" " goto error;\n" " }\n" " PyInitConfig_Free(config);\n" " return 0;\n" "\n" "error:\n" " {\n" " // Display the error message.\n" " //\n" " // This uncommon braces style is used, because you cannot make\n" " // goto targets point to variable declarations.\n" " const char *err_msg;\n" " (void)PyInitConfig_GetError(config, &err_msg);\n" " printf(\"PYTHON INIT ERROR: %s\\n\", err_msg);\n" " PyInitConfig_Free(config);\n" " return -1;\n" " }\n" "}" msgstr "" #: ../../c-api/init_config.rst:71 msgid "Create Config" msgstr "" #: ../../c-api/init_config.rst:75 msgid "Opaque structure to configure the Python initialization." msgstr "" #: ../../c-api/init_config.rst:80 msgid "" "Create a new initialization configuration using :ref:`Isolated Configuration" " ` default values." msgstr "" #: ../../c-api/init_config.rst:83 msgid "It must be freed by :c:func:`PyInitConfig_Free`." msgstr "" #: ../../c-api/init_config.rst:85 msgid "Return ``NULL`` on memory allocation failure." msgstr "" #: ../../c-api/init_config.rst:90 msgid "Free memory of the initialization configuration *config*." msgstr "" #: ../../c-api/init_config.rst:92 msgid "If *config* is ``NULL``, no operation is performed." msgstr "" #: ../../c-api/init_config.rst:96 msgid "Error Handling" msgstr "Penanganan Kesalahan" #: ../../c-api/init_config.rst:100 msgid "Get the *config* error message." msgstr "" #: ../../c-api/init_config.rst:102 msgid "Set *\\*err_msg* and return ``1`` if an error is set." msgstr "" #: ../../c-api/init_config.rst:103 msgid "Set *\\*err_msg* to ``NULL`` and return ``0`` otherwise." msgstr "" #: ../../c-api/init_config.rst:105 msgid "An error message is an UTF-8 encoded string." msgstr "" #: ../../c-api/init_config.rst:107 msgid "" "If *config* has an exit code, format the exit code as an error message." msgstr "" #: ../../c-api/init_config.rst:110 msgid "" "The error message remains valid until another ``PyInitConfig`` function is " "called with *config*. The caller doesn't have to free the error message." msgstr "" #: ../../c-api/init_config.rst:117 msgid "Get the *config* exit code." msgstr "" #: ../../c-api/init_config.rst:119 msgid "Set *\\*exitcode* and return ``1`` if *config* has an exit code set." msgstr "" #: ../../c-api/init_config.rst:120 msgid "Return ``0`` if *config* has no exit code set." msgstr "" #: ../../c-api/init_config.rst:122 msgid "" "Only the ``Py_InitializeFromInitConfig()`` function can set an exit code if " "the ``parse_argv`` option is non-zero." msgstr "" #: ../../c-api/init_config.rst:125 msgid "" "An exit code can be set when parsing the command line failed (exit code " "``2``) or when a command line option asks to display the command line help " "(exit code ``0``)." msgstr "" #: ../../c-api/init_config.rst:131 msgid "Get Options" msgstr "" #: ../../c-api/init_config.rst:133 ../../c-api/init_config.rst:187 #: ../../c-api/init_config.rst:559 msgid "" "The configuration option *name* parameter must be a non-NULL null-terminated" " UTF-8 encoded string. See :ref:`Configuration Options `." msgstr "" #: ../../c-api/init_config.rst:138 msgid "Test if the configuration has an option called *name*." msgstr "" #: ../../c-api/init_config.rst:140 msgid "Return ``1`` if the option exists, or return ``0`` otherwise." msgstr "" #: ../../c-api/init_config.rst:145 msgid "Get an integer configuration option." msgstr "" #: ../../c-api/init_config.rst:147 ../../c-api/init_config.rst:156 msgid "Set *\\*value*, and return ``0`` on success." msgstr "" #: ../../c-api/init_config.rst:148 ../../c-api/init_config.rst:157 #: ../../c-api/init_config.rst:172 ../../c-api/init_config.rst:200 #: ../../c-api/init_config.rst:209 ../../c-api/init_config.rst:218 #: ../../c-api/init_config.rst:233 ../../c-api/init_config.rst:249 msgid "Set an error in *config* and return ``-1`` on error." msgstr "" #: ../../c-api/init_config.rst:153 msgid "" "Get a string configuration option as a null-terminated UTF-8 encoded string." msgstr "" #: ../../c-api/init_config.rst:159 msgid "" "*\\*value* can be set to ``NULL`` if the option is an optional string and " "the option is unset." msgstr "" #: ../../c-api/init_config.rst:162 msgid "" "On success, the string must be released with ``free(value)`` if it's not " "``NULL``." msgstr "" #: ../../c-api/init_config.rst:168 msgid "" "Get a string list configuration option as an array of null-terminated UTF-8 " "encoded strings." msgstr "" #: ../../c-api/init_config.rst:171 msgid "Set *\\*length* and *\\*value*, and return ``0`` on success." msgstr "" #: ../../c-api/init_config.rst:174 msgid "" "On success, the string list must be released with " "``PyInitConfig_FreeStrList(length, items)``." msgstr "" #: ../../c-api/init_config.rst:180 msgid "Free memory of a string list created by ``PyInitConfig_GetStrList()``." msgstr "" #: ../../c-api/init_config.rst:185 msgid "Set Options" msgstr "" #: ../../c-api/init_config.rst:190 msgid "" "Some configuration options have side effects on other options. This logic is" " only implemented when ``Py_InitializeFromInitConfig()`` is called, not by " "the \"Set\" functions below. For example, setting ``dev_mode`` to ``1`` does" " not set ``faulthandler`` to ``1``." msgstr "" #: ../../c-api/init_config.rst:197 msgid "Set an integer configuration option." msgstr "" #: ../../c-api/init_config.rst:199 ../../c-api/init_config.rst:208 #: ../../c-api/init_config.rst:217 ../../c-api/init_config.rst:232 #: ../../c-api/init_config.rst:248 ../../c-api/init_config.rst:591 msgid "Return ``0`` on success." msgstr "" #: ../../c-api/init_config.rst:205 msgid "" "Set a string configuration option from a null-terminated UTF-8 encoded " "string. The string is copied." msgstr "" #: ../../c-api/init_config.rst:214 msgid "" "Set a string list configuration option from an array of null-terminated " "UTF-8 encoded strings. The string list is copied." msgstr "" #: ../../c-api/init_config.rst:222 msgid "Module" msgstr "" #: ../../c-api/init_config.rst:226 msgid "Add a built-in extension module to the table of built-in modules." msgstr "" #: ../../c-api/init_config.rst:228 msgid "" "The new module can be imported by the name *name*, and uses the function " "*initfunc* as the initialization function called on the first attempted " "import." msgstr "" #: ../../c-api/init_config.rst:235 msgid "" "If Python is initialized multiple times, ``PyInitConfig_AddModule()`` must " "be called at each Python initialization." msgstr "" #: ../../c-api/init_config.rst:238 msgid "Similar to the :c:func:`PyImport_AppendInittab` function." msgstr "" #: ../../c-api/init_config.rst:242 msgid "Initialize Python" msgstr "" #: ../../c-api/init_config.rst:246 msgid "Initialize Python from the initialization configuration." msgstr "" #: ../../c-api/init_config.rst:250 msgid "" "Set an exit code in *config* and return ``-1`` if Python wants to exit." msgstr "" #: ../../c-api/init_config.rst:253 msgid "See ``PyInitConfig_GetExitcode()`` for the exit code case." msgstr "" #: ../../c-api/init_config.rst:259 msgid "Configuration Options" msgstr "" #: ../../c-api/init_config.rst:264 msgid "Option" msgstr "Opsi" #: ../../c-api/init_config.rst:265 msgid "PyConfig/PyPreConfig member" msgstr "" #: ../../c-api/init_config.rst:266 msgid "Type" msgstr "" #: ../../c-api/init_config.rst:267 msgid "Visibility" msgstr "" #: ../../c-api/init_config.rst:268 msgid "``\"allocator\"``" msgstr "" #: ../../c-api/init_config.rst:269 msgid ":c:member:`allocator `" msgstr "" #: ../../c-api/init_config.rst:270 ../../c-api/init_config.rst:294 #: ../../c-api/init_config.rst:322 ../../c-api/init_config.rst:358 #: ../../c-api/init_config.rst:366 ../../c-api/init_config.rst:378 #: ../../c-api/init_config.rst:406 ../../c-api/init_config.rst:494 #: ../../c-api/init_config.rst:522 ../../c-api/init_config.rst:576 msgid "``int``" msgstr "``int``" #: ../../c-api/init_config.rst:271 ../../c-api/init_config.rst:291 #: ../../c-api/init_config.rst:299 ../../c-api/init_config.rst:303 #: ../../c-api/init_config.rst:307 ../../c-api/init_config.rst:311 #: ../../c-api/init_config.rst:315 ../../c-api/init_config.rst:319 #: ../../c-api/init_config.rst:327 ../../c-api/init_config.rst:331 #: ../../c-api/init_config.rst:335 ../../c-api/init_config.rst:347 #: ../../c-api/init_config.rst:351 ../../c-api/init_config.rst:355 #: ../../c-api/init_config.rst:359 ../../c-api/init_config.rst:363 #: ../../c-api/init_config.rst:367 ../../c-api/init_config.rst:375 #: ../../c-api/init_config.rst:387 ../../c-api/init_config.rst:391 #: ../../c-api/init_config.rst:395 ../../c-api/init_config.rst:399 #: ../../c-api/init_config.rst:411 ../../c-api/init_config.rst:415 #: ../../c-api/init_config.rst:423 ../../c-api/init_config.rst:427 #: ../../c-api/init_config.rst:439 ../../c-api/init_config.rst:451 #: ../../c-api/init_config.rst:455 ../../c-api/init_config.rst:459 #: ../../c-api/init_config.rst:463 ../../c-api/init_config.rst:467 #: ../../c-api/init_config.rst:471 ../../c-api/init_config.rst:475 #: ../../c-api/init_config.rst:479 ../../c-api/init_config.rst:483 #: ../../c-api/init_config.rst:487 ../../c-api/init_config.rst:495 #: ../../c-api/init_config.rst:503 ../../c-api/init_config.rst:507 #: ../../c-api/init_config.rst:511 ../../c-api/init_config.rst:515 #: ../../c-api/init_config.rst:519 ../../c-api/init_config.rst:527 #: ../../c-api/init_config.rst:543 msgid "Read-only" msgstr "" #: ../../c-api/init_config.rst:272 msgid "``\"argv\"``" msgstr "" #: ../../c-api/init_config.rst:273 msgid ":c:member:`argv `" msgstr "" #: ../../c-api/init_config.rst:274 ../../c-api/init_config.rst:402 #: ../../c-api/init_config.rst:410 ../../c-api/init_config.rst:530 #: ../../c-api/init_config.rst:578 msgid "``list[str]``" msgstr "" #: ../../c-api/init_config.rst:275 ../../c-api/init_config.rst:279 #: ../../c-api/init_config.rst:283 ../../c-api/init_config.rst:287 #: ../../c-api/init_config.rst:295 ../../c-api/init_config.rst:323 #: ../../c-api/init_config.rst:339 ../../c-api/init_config.rst:343 #: ../../c-api/init_config.rst:371 ../../c-api/init_config.rst:379 #: ../../c-api/init_config.rst:383 ../../c-api/init_config.rst:403 #: ../../c-api/init_config.rst:407 ../../c-api/init_config.rst:419 #: ../../c-api/init_config.rst:431 ../../c-api/init_config.rst:435 #: ../../c-api/init_config.rst:443 ../../c-api/init_config.rst:447 #: ../../c-api/init_config.rst:491 ../../c-api/init_config.rst:499 #: ../../c-api/init_config.rst:523 ../../c-api/init_config.rst:531 #: ../../c-api/init_config.rst:535 ../../c-api/init_config.rst:539 msgid "Public" msgstr "" #: ../../c-api/init_config.rst:276 msgid "``\"base_exec_prefix\"``" msgstr "" #: ../../c-api/init_config.rst:277 msgid ":c:member:`base_exec_prefix `" msgstr "" #: ../../c-api/init_config.rst:278 ../../c-api/init_config.rst:282 #: ../../c-api/init_config.rst:286 ../../c-api/init_config.rst:298 #: ../../c-api/init_config.rst:334 ../../c-api/init_config.rst:338 #: ../../c-api/init_config.rst:342 ../../c-api/init_config.rst:350 #: ../../c-api/init_config.rst:354 ../../c-api/init_config.rst:362 #: ../../c-api/init_config.rst:430 ../../c-api/init_config.rst:434 #: ../../c-api/init_config.rst:438 ../../c-api/init_config.rst:442 #: ../../c-api/init_config.rst:450 ../../c-api/init_config.rst:454 #: ../../c-api/init_config.rst:458 ../../c-api/init_config.rst:462 #: ../../c-api/init_config.rst:482 ../../c-api/init_config.rst:486 #: ../../c-api/init_config.rst:490 ../../c-api/init_config.rst:577 msgid "``str``" msgstr "``str``" #: ../../c-api/init_config.rst:280 msgid "``\"base_executable\"``" msgstr "" #: ../../c-api/init_config.rst:281 msgid ":c:member:`base_executable `" msgstr "" #: ../../c-api/init_config.rst:284 msgid "``\"base_prefix\"``" msgstr "" #: ../../c-api/init_config.rst:285 msgid ":c:member:`base_prefix `" msgstr "" #: ../../c-api/init_config.rst:288 msgid "``\"buffered_stdio\"``" msgstr "" #: ../../c-api/init_config.rst:289 msgid ":c:member:`buffered_stdio `" msgstr "" #: ../../c-api/init_config.rst:290 ../../c-api/init_config.rst:302 #: ../../c-api/init_config.rst:306 ../../c-api/init_config.rst:310 #: ../../c-api/init_config.rst:314 ../../c-api/init_config.rst:318 #: ../../c-api/init_config.rst:326 ../../c-api/init_config.rst:330 #: ../../c-api/init_config.rst:346 ../../c-api/init_config.rst:370 #: ../../c-api/init_config.rst:374 ../../c-api/init_config.rst:382 #: ../../c-api/init_config.rst:386 ../../c-api/init_config.rst:390 #: ../../c-api/init_config.rst:394 ../../c-api/init_config.rst:398 #: ../../c-api/init_config.rst:414 ../../c-api/init_config.rst:418 #: ../../c-api/init_config.rst:422 ../../c-api/init_config.rst:426 #: ../../c-api/init_config.rst:446 ../../c-api/init_config.rst:466 #: ../../c-api/init_config.rst:470 ../../c-api/init_config.rst:474 #: ../../c-api/init_config.rst:478 ../../c-api/init_config.rst:498 #: ../../c-api/init_config.rst:502 ../../c-api/init_config.rst:506 #: ../../c-api/init_config.rst:510 ../../c-api/init_config.rst:514 #: ../../c-api/init_config.rst:518 ../../c-api/init_config.rst:526 #: ../../c-api/init_config.rst:534 ../../c-api/init_config.rst:542 #: ../../c-api/init_config.rst:575 msgid "``bool``" msgstr "``bool``" #: ../../c-api/init_config.rst:292 msgid "``\"bytes_warning\"``" msgstr "" #: ../../c-api/init_config.rst:293 msgid ":c:member:`bytes_warning `" msgstr "" #: ../../c-api/init_config.rst:296 msgid "``\"check_hash_pycs_mode\"``" msgstr "" #: ../../c-api/init_config.rst:297 msgid ":c:member:`check_hash_pycs_mode `" msgstr "" #: ../../c-api/init_config.rst:300 msgid "``\"code_debug_ranges\"``" msgstr "" #: ../../c-api/init_config.rst:301 msgid ":c:member:`code_debug_ranges `" msgstr "" #: ../../c-api/init_config.rst:304 msgid "``\"coerce_c_locale\"``" msgstr "" #: ../../c-api/init_config.rst:305 msgid ":c:member:`coerce_c_locale `" msgstr "" #: ../../c-api/init_config.rst:308 msgid "``\"coerce_c_locale_warn\"``" msgstr "" #: ../../c-api/init_config.rst:309 msgid ":c:member:`coerce_c_locale_warn `" msgstr "" #: ../../c-api/init_config.rst:312 msgid "``\"configure_c_stdio\"``" msgstr "" #: ../../c-api/init_config.rst:313 msgid ":c:member:`configure_c_stdio `" msgstr "" #: ../../c-api/init_config.rst:316 msgid "``\"configure_locale\"``" msgstr "" #: ../../c-api/init_config.rst:317 msgid ":c:member:`configure_locale `" msgstr "" #: ../../c-api/init_config.rst:320 msgid "``\"cpu_count\"``" msgstr "" #: ../../c-api/init_config.rst:321 msgid ":c:member:`cpu_count `" msgstr "" #: ../../c-api/init_config.rst:324 msgid "``\"dev_mode\"``" msgstr "" #: ../../c-api/init_config.rst:325 msgid ":c:member:`dev_mode `" msgstr "" #: ../../c-api/init_config.rst:328 msgid "``\"dump_refs\"``" msgstr "" #: ../../c-api/init_config.rst:329 msgid ":c:member:`dump_refs `" msgstr "" #: ../../c-api/init_config.rst:332 msgid "``\"dump_refs_file\"``" msgstr "" #: ../../c-api/init_config.rst:333 msgid ":c:member:`dump_refs_file `" msgstr "" #: ../../c-api/init_config.rst:336 msgid "``\"exec_prefix\"``" msgstr "" #: ../../c-api/init_config.rst:337 msgid ":c:member:`exec_prefix `" msgstr "" #: ../../c-api/init_config.rst:340 msgid "``\"executable\"``" msgstr "" #: ../../c-api/init_config.rst:341 msgid ":c:member:`executable `" msgstr "" #: ../../c-api/init_config.rst:344 msgid "``\"faulthandler\"``" msgstr "" #: ../../c-api/init_config.rst:345 msgid ":c:member:`faulthandler `" msgstr "" #: ../../c-api/init_config.rst:348 msgid "``\"filesystem_encoding\"``" msgstr "" #: ../../c-api/init_config.rst:349 msgid ":c:member:`filesystem_encoding `" msgstr "" #: ../../c-api/init_config.rst:352 msgid "``\"filesystem_errors\"``" msgstr "" #: ../../c-api/init_config.rst:353 msgid ":c:member:`filesystem_errors `" msgstr "" #: ../../c-api/init_config.rst:356 msgid "``\"hash_seed\"``" msgstr "" #: ../../c-api/init_config.rst:357 msgid ":c:member:`hash_seed `" msgstr "" #: ../../c-api/init_config.rst:360 msgid "``\"home\"``" msgstr "" #: ../../c-api/init_config.rst:361 msgid ":c:member:`home `" msgstr "" #: ../../c-api/init_config.rst:364 msgid "``\"import_time\"``" msgstr "" #: ../../c-api/init_config.rst:365 msgid ":c:member:`import_time `" msgstr "" #: ../../c-api/init_config.rst:368 msgid "``\"inspect\"``" msgstr "" #: ../../c-api/init_config.rst:369 msgid ":c:member:`inspect `" msgstr "" #: ../../c-api/init_config.rst:372 msgid "``\"install_signal_handlers\"``" msgstr "" #: ../../c-api/init_config.rst:373 msgid ":c:member:`install_signal_handlers `" msgstr "" #: ../../c-api/init_config.rst:376 msgid "``\"int_max_str_digits\"``" msgstr "" #: ../../c-api/init_config.rst:377 msgid ":c:member:`int_max_str_digits `" msgstr "" #: ../../c-api/init_config.rst:380 msgid "``\"interactive\"``" msgstr "" #: ../../c-api/init_config.rst:381 msgid ":c:member:`interactive `" msgstr "" #: ../../c-api/init_config.rst:384 msgid "``\"isolated\"``" msgstr "" #: ../../c-api/init_config.rst:385 msgid ":c:member:`isolated `" msgstr "" #: ../../c-api/init_config.rst:388 msgid "``\"legacy_windows_fs_encoding\"``" msgstr "" #: ../../c-api/init_config.rst:389 msgid "" ":c:member:`legacy_windows_fs_encoding " "`" msgstr "" #: ../../c-api/init_config.rst:392 msgid "``\"legacy_windows_stdio\"``" msgstr "" #: ../../c-api/init_config.rst:393 msgid ":c:member:`legacy_windows_stdio `" msgstr "" #: ../../c-api/init_config.rst:396 msgid "``\"malloc_stats\"``" msgstr "" #: ../../c-api/init_config.rst:397 msgid ":c:member:`malloc_stats `" msgstr "" #: ../../c-api/init_config.rst:400 msgid "``\"module_search_paths\"``" msgstr "" #: ../../c-api/init_config.rst:401 msgid ":c:member:`module_search_paths `" msgstr "" #: ../../c-api/init_config.rst:404 msgid "``\"optimization_level\"``" msgstr "" #: ../../c-api/init_config.rst:405 msgid ":c:member:`optimization_level `" msgstr "" #: ../../c-api/init_config.rst:408 msgid "``\"orig_argv\"``" msgstr "" #: ../../c-api/init_config.rst:409 msgid ":c:member:`orig_argv `" msgstr "" #: ../../c-api/init_config.rst:412 msgid "``\"parse_argv\"``" msgstr "" #: ../../c-api/init_config.rst:413 msgid ":c:member:`parse_argv `" msgstr "" #: ../../c-api/init_config.rst:416 msgid "``\"parser_debug\"``" msgstr "" #: ../../c-api/init_config.rst:417 msgid ":c:member:`parser_debug `" msgstr "" #: ../../c-api/init_config.rst:420 msgid "``\"pathconfig_warnings\"``" msgstr "" #: ../../c-api/init_config.rst:421 msgid ":c:member:`pathconfig_warnings `" msgstr "" #: ../../c-api/init_config.rst:424 msgid "``\"perf_profiling\"``" msgstr "" #: ../../c-api/init_config.rst:425 msgid ":c:member:`perf_profiling `" msgstr "" #: ../../c-api/init_config.rst:428 msgid "``\"platlibdir\"``" msgstr "" #: ../../c-api/init_config.rst:429 msgid ":c:member:`platlibdir `" msgstr "" #: ../../c-api/init_config.rst:432 msgid "``\"prefix\"``" msgstr "" #: ../../c-api/init_config.rst:433 msgid ":c:member:`prefix `" msgstr "" #: ../../c-api/init_config.rst:436 msgid "``\"program_name\"``" msgstr "" #: ../../c-api/init_config.rst:437 msgid ":c:member:`program_name `" msgstr "" #: ../../c-api/init_config.rst:440 msgid "``\"pycache_prefix\"``" msgstr "" #: ../../c-api/init_config.rst:441 msgid ":c:member:`pycache_prefix `" msgstr "" #: ../../c-api/init_config.rst:444 msgid "``\"quiet\"``" msgstr "" #: ../../c-api/init_config.rst:445 msgid ":c:member:`quiet `" msgstr "" #: ../../c-api/init_config.rst:448 msgid "``\"run_command\"``" msgstr "" #: ../../c-api/init_config.rst:449 msgid ":c:member:`run_command `" msgstr "" #: ../../c-api/init_config.rst:452 msgid "``\"run_filename\"``" msgstr "" #: ../../c-api/init_config.rst:453 msgid ":c:member:`run_filename `" msgstr "" #: ../../c-api/init_config.rst:456 msgid "``\"run_module\"``" msgstr "" #: ../../c-api/init_config.rst:457 msgid ":c:member:`run_module `" msgstr "" #: ../../c-api/init_config.rst:460 msgid "``\"run_presite\"``" msgstr "" #: ../../c-api/init_config.rst:461 msgid ":c:member:`run_presite `" msgstr "" #: ../../c-api/init_config.rst:464 msgid "``\"safe_path\"``" msgstr "" #: ../../c-api/init_config.rst:465 msgid ":c:member:`safe_path `" msgstr "" #: ../../c-api/init_config.rst:468 msgid "``\"show_ref_count\"``" msgstr "" #: ../../c-api/init_config.rst:469 msgid ":c:member:`show_ref_count `" msgstr "" #: ../../c-api/init_config.rst:472 msgid "``\"site_import\"``" msgstr "" #: ../../c-api/init_config.rst:473 msgid ":c:member:`site_import `" msgstr "" #: ../../c-api/init_config.rst:476 msgid "``\"skip_source_first_line\"``" msgstr "" #: ../../c-api/init_config.rst:477 msgid ":c:member:`skip_source_first_line `" msgstr "" #: ../../c-api/init_config.rst:480 msgid "``\"stdio_encoding\"``" msgstr "" #: ../../c-api/init_config.rst:481 msgid ":c:member:`stdio_encoding `" msgstr "" #: ../../c-api/init_config.rst:484 msgid "``\"stdio_errors\"``" msgstr "" #: ../../c-api/init_config.rst:485 msgid ":c:member:`stdio_errors `" msgstr "" #: ../../c-api/init_config.rst:488 msgid "``\"stdlib_dir\"``" msgstr "" #: ../../c-api/init_config.rst:489 msgid ":c:member:`stdlib_dir `" msgstr "" #: ../../c-api/init_config.rst:492 msgid "``\"tracemalloc\"``" msgstr "" #: ../../c-api/init_config.rst:493 msgid ":c:member:`tracemalloc `" msgstr "" #: ../../c-api/init_config.rst:496 msgid "``\"use_environment\"``" msgstr "" #: ../../c-api/init_config.rst:497 msgid ":c:member:`use_environment `" msgstr "" #: ../../c-api/init_config.rst:500 msgid "``\"use_frozen_modules\"``" msgstr "" #: ../../c-api/init_config.rst:501 msgid ":c:member:`use_frozen_modules `" msgstr "" #: ../../c-api/init_config.rst:504 msgid "``\"use_hash_seed\"``" msgstr "" #: ../../c-api/init_config.rst:505 msgid ":c:member:`use_hash_seed `" msgstr "" #: ../../c-api/init_config.rst:508 msgid "``\"use_system_logger\"``" msgstr "" #: ../../c-api/init_config.rst:509 msgid ":c:member:`use_system_logger `" msgstr "" #: ../../c-api/init_config.rst:512 msgid "``\"user_site_directory\"``" msgstr "" #: ../../c-api/init_config.rst:513 msgid ":c:member:`user_site_directory `" msgstr "" #: ../../c-api/init_config.rst:516 msgid "``\"utf8_mode\"``" msgstr "" #: ../../c-api/init_config.rst:517 msgid ":c:member:`utf8_mode `" msgstr "" #: ../../c-api/init_config.rst:520 msgid "``\"verbose\"``" msgstr "" #: ../../c-api/init_config.rst:521 msgid ":c:member:`verbose `" msgstr "" #: ../../c-api/init_config.rst:524 msgid "``\"warn_default_encoding\"``" msgstr "" #: ../../c-api/init_config.rst:525 msgid ":c:member:`warn_default_encoding `" msgstr "" #: ../../c-api/init_config.rst:528 msgid "``\"warnoptions\"``" msgstr "" #: ../../c-api/init_config.rst:529 msgid ":c:member:`warnoptions `" msgstr "" #: ../../c-api/init_config.rst:532 msgid "``\"write_bytecode\"``" msgstr "" #: ../../c-api/init_config.rst:533 msgid ":c:member:`write_bytecode `" msgstr "" #: ../../c-api/init_config.rst:536 msgid "``\"xoptions\"``" msgstr "" #: ../../c-api/init_config.rst:537 msgid ":c:member:`xoptions `" msgstr "" #: ../../c-api/init_config.rst:538 ../../c-api/init_config.rst:579 msgid "``dict[str, str]``" msgstr "" #: ../../c-api/init_config.rst:540 msgid "``\"_pystats\"``" msgstr "" #: ../../c-api/init_config.rst:541 msgid ":c:member:`_pystats `" msgstr "" #: ../../c-api/init_config.rst:545 msgid "Visibility:" msgstr "" #: ../../c-api/init_config.rst:547 msgid "" "Public: Can by get by :c:func:`PyConfig_Get` and set by " ":c:func:`PyConfig_Set`." msgstr "" #: ../../c-api/init_config.rst:549 msgid "" "Read-only: Can by get by :c:func:`PyConfig_Get`, but cannot be set by " ":c:func:`PyConfig_Set`." msgstr "" #: ../../c-api/init_config.rst:554 msgid "Runtime Python configuration API" msgstr "" #: ../../c-api/init_config.rst:556 msgid "" "At runtime, it's possible to get and set configuration options using " ":c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions." msgstr "" #: ../../c-api/init_config.rst:562 msgid "" "Some options are read from the :mod:`sys` attributes. For example, the " "option ``\"argv\"`` is read from :data:`sys.argv`." msgstr "" #: ../../c-api/init_config.rst:568 msgid "" "Get the current runtime value of a configuration option as a Python object." msgstr "" #: ../../c-api/init_config.rst:570 ../../c-api/init_config.rst:601 msgid "Return a new reference on success." msgstr "" #: ../../c-api/init_config.rst:571 ../../c-api/init_config.rst:602 msgid "Set an exception and return ``NULL`` on error." msgstr "" #: ../../c-api/init_config.rst:573 msgid "The object type depends on the configuration option. It can be:" msgstr "" #: ../../c-api/init_config.rst:581 ../../c-api/init_config.rst:604 #: ../../c-api/init_config.rst:619 msgid "" "The caller must have an :term:`attached thread state`. The function cannot " "be called before Python initialization nor after Python finalization." msgstr "" #: ../../c-api/init_config.rst:589 msgid "Similar to :c:func:`PyConfig_Get`, but get the value as a C int." msgstr "" #: ../../c-api/init_config.rst:592 msgid "Set an exception and return ``-1`` on error." msgstr "" #: ../../c-api/init_config.rst:599 msgid "Get all configuration option names as a ``frozenset``." msgstr "" #: ../../c-api/init_config.rst:612 msgid "Set the current runtime value of a configuration option." msgstr "" #: ../../c-api/init_config.rst:614 msgid "Raise a :exc:`ValueError` if there is no option *name*." msgstr "" #: ../../c-api/init_config.rst:615 msgid "Raise a :exc:`ValueError` if *value* is an invalid value." msgstr "" #: ../../c-api/init_config.rst:616 msgid "Raise a :exc:`ValueError` if the option is read-only (cannot be set)." msgstr "" #: ../../c-api/init_config.rst:617 msgid "Raise a :exc:`TypeError` if *value* has not the proper type." msgstr "" #: ../../c-api/init_config.rst:622 msgid "" "Raises an :ref:`auditing event ` ``cpython.PyConfig_Set`` with " "arguments ``name``, ``value``." msgstr "" #: ../../c-api/init_config.rst:630 msgid "PyConfig C API" msgstr "" #: ../../c-api/init_config.rst:634 msgid "" "Python can be initialized with :c:func:`Py_InitializeFromConfig` and the " ":c:type:`PyConfig` structure. It can be preinitialized with " ":c:func:`Py_PreInitialize` and the :c:type:`PyPreConfig` structure." msgstr "" #: ../../c-api/init_config.rst:638 msgid "There are two kinds of configuration:" msgstr "" #: ../../c-api/init_config.rst:640 msgid "" "The :ref:`Python Configuration ` can be used to build a " "customized Python which behaves as the regular Python. For example, " "environment variables and command line arguments are used to configure " "Python." msgstr "" #: ../../c-api/init_config.rst:645 msgid "" "The :ref:`Isolated Configuration ` can be used to embed " "Python into an application. It isolates Python from the system. For example," " environment variables are ignored, the LC_CTYPE locale is left unchanged " "and no signal handler is registered." msgstr "" #: ../../c-api/init_config.rst:656 msgid ":pep:`587` \"Python Initialization Configuration\"." msgstr "" #: ../../c-api/init_config.rst:662 msgid "Example of customized Python always running in isolated mode::" msgstr "" #: ../../c-api/init_config.rst:664 msgid "" "int main(int argc, char **argv)\n" "{\n" " PyStatus status;\n" "\n" " PyConfig config;\n" " PyConfig_InitPythonConfig(&config);\n" " config.isolated = 1;\n" "\n" " /* Decode command line arguments.\n" " Implicitly preinitialize Python (in isolated mode). */\n" " status = PyConfig_SetBytesArgv(&config, argc, argv);\n" " if (PyStatus_Exception(status)) {\n" " goto exception;\n" " }\n" "\n" " status = Py_InitializeFromConfig(&config);\n" " if (PyStatus_Exception(status)) {\n" " goto exception;\n" " }\n" " PyConfig_Clear(&config);\n" "\n" " return Py_RunMain();\n" "\n" "exception:\n" " PyConfig_Clear(&config);\n" " if (PyStatus_IsExit(status)) {\n" " return status.exitcode;\n" " }\n" " /* Display the error message and exit the process with\n" " non-zero exit code */\n" " Py_ExitStatusException(status);\n" "}" msgstr "" #: ../../c-api/init_config.rst:699 msgid "PyWideStringList" msgstr "" #: ../../c-api/init_config.rst:703 msgid "List of ``wchar_t*`` strings." msgstr "" #: ../../c-api/init_config.rst:705 msgid "" "If *length* is non-zero, *items* must be non-``NULL`` and all strings must " "be non-``NULL``." msgstr "" #: ../../c-api/init_config.rst:710 msgid "Methods:" msgstr "" #: ../../c-api/init_config.rst:714 msgid "Append *item* to *list*." msgstr "" #: ../../c-api/init_config.rst:716 ../../c-api/init_config.rst:727 msgid "Python must be preinitialized to call this function." msgstr "" #: ../../c-api/init_config.rst:720 msgid "Insert *item* into *list* at *index*." msgstr "" #: ../../c-api/init_config.rst:722 msgid "" "If *index* is greater than or equal to *list* length, append *item* to " "*list*." msgstr "" #: ../../c-api/init_config.rst:725 msgid "*index* must be greater than or equal to ``0``." msgstr "" #: ../../c-api/init_config.rst:731 ../../c-api/init_config.rst:751 #: ../../c-api/init_config.rst:858 ../../c-api/init_config.rst:1177 msgid "Structure fields:" msgstr "" #: ../../c-api/init_config.rst:735 msgid "List length." msgstr "" #: ../../c-api/init_config.rst:739 msgid "List items." msgstr "" #: ../../c-api/init_config.rst:742 msgid "PyStatus" msgstr "" #: ../../c-api/init_config.rst:746 msgid "" "Structure to store an initialization function status: success, error or " "exit." msgstr "" #: ../../c-api/init_config.rst:749 msgid "" "For an error, it can store the C function name which created the error." msgstr "" #: ../../c-api/init_config.rst:755 msgid "Exit code. Argument passed to ``exit()``." msgstr "" #: ../../c-api/init_config.rst:759 msgid "Error message." msgstr "" #: ../../c-api/init_config.rst:763 msgid "Name of the function which created an error, can be ``NULL``." msgstr "" #: ../../c-api/init_config.rst:767 msgid "Functions to create a status:" msgstr "" #: ../../c-api/init_config.rst:771 msgid "Success." msgstr "" #: ../../c-api/init_config.rst:775 msgid "Initialization error with a message." msgstr "" #: ../../c-api/init_config.rst:777 msgid "*err_msg* must not be ``NULL``." msgstr "" #: ../../c-api/init_config.rst:781 msgid "Memory allocation failure (out of memory)." msgstr "" #: ../../c-api/init_config.rst:785 msgid "Exit Python with the specified exit code." msgstr "" #: ../../c-api/init_config.rst:787 msgid "Functions to handle a status:" msgstr "" #: ../../c-api/init_config.rst:791 msgid "" "Is the status an error or an exit? If true, the exception must be handled; " "by calling :c:func:`Py_ExitStatusException` for example." msgstr "" #: ../../c-api/init_config.rst:796 msgid "Is the result an error?" msgstr "" #: ../../c-api/init_config.rst:800 msgid "Is the result an exit?" msgstr "" #: ../../c-api/init_config.rst:804 msgid "" "Call ``exit(exitcode)`` if *status* is an exit. Print the error message and " "exit with a non-zero exit code if *status* is an error. Must only be called" " if ``PyStatus_Exception(status)`` is non-zero." msgstr "" #: ../../c-api/init_config.rst:809 msgid "" "Internally, Python uses macros which set ``PyStatus.func``, whereas " "functions to create a status set ``func`` to ``NULL``." msgstr "" #: ../../c-api/init_config.rst:812 msgid "Example::" msgstr "Contoh::" #: ../../c-api/init_config.rst:814 msgid "" "PyStatus alloc(void **ptr, size_t size)\n" "{\n" " *ptr = PyMem_RawMalloc(size);\n" " if (*ptr == NULL) {\n" " return PyStatus_NoMemory();\n" " }\n" " return PyStatus_Ok();\n" "}\n" "\n" "int main(int argc, char **argv)\n" "{\n" " void *ptr;\n" " PyStatus status = alloc(&ptr, 16);\n" " if (PyStatus_Exception(status)) {\n" " Py_ExitStatusException(status);\n" " }\n" " PyMem_Free(ptr);\n" " return 0;\n" "}" msgstr "" #: ../../c-api/init_config.rst:836 msgid "PyPreConfig" msgstr "" #: ../../c-api/init_config.rst:840 msgid "Structure used to preinitialize Python." msgstr "" #: ../../c-api/init_config.rst:844 msgid "Function to initialize a preconfiguration:" msgstr "" #: ../../c-api/init_config.rst:848 msgid "" "Initialize the preconfiguration with :ref:`Python Configuration `." msgstr "" #: ../../c-api/init_config.rst:853 msgid "" "Initialize the preconfiguration with :ref:`Isolated Configuration `." msgstr "" #: ../../c-api/init_config.rst:862 msgid "Name of the Python memory allocators:" msgstr "" #: ../../c-api/init_config.rst:864 msgid "" "``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use " "defaults)." msgstr "" #: ../../c-api/init_config.rst:866 msgid "" "``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`default memory allocators " "`." msgstr "" #: ../../c-api/init_config.rst:868 msgid "" "``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." msgstr "" #: ../../c-api/init_config.rst:871 msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): use ``malloc()`` of the C library." msgstr "" #: ../../c-api/init_config.rst:872 msgid "" "``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with " ":ref:`debug hooks `." msgstr "" #: ../../c-api/init_config.rst:874 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator" " `." msgstr "" #: ../../c-api/init_config.rst:876 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " "allocator ` with :ref:`debug hooks `." msgstr "" #: ../../c-api/init_config.rst:879 msgid "" "``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): use ``mimalloc``, a fast malloc " "replacement." msgstr "" #: ../../c-api/init_config.rst:881 msgid "" "``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): use ``mimalloc``, a fast malloc " "replacement with :ref:`debug hooks `." msgstr "" #: ../../c-api/init_config.rst:885 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not " "supported if Python is :option:`configured using --without-pymalloc " "<--without-pymalloc>`." msgstr "" #: ../../c-api/init_config.rst:889 msgid "" "``PYMEM_ALLOCATOR_MIMALLOC`` and ``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` are not " "supported if Python is :option:`configured using --without-mimalloc " "<--without-mimalloc>` or if the underlying atomic support isn't available." msgstr "" #: ../../c-api/init_config.rst:894 msgid "See :ref:`Memory Management `." msgstr "" #: ../../c-api/init_config.rst:896 msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" #: ../../c-api/init_config.rst:900 msgid "Set the LC_CTYPE locale to the user preferred locale." msgstr "" #: ../../c-api/init_config.rst:902 msgid "" "If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and " ":c:member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" #: ../../c-api/init_config.rst:905 ../../c-api/init_config.rst:916 msgid "See the :term:`locale encoding`." msgstr "" #: ../../c-api/init_config.rst:907 ../../c-api/init_config.rst:962 #: ../../c-api/init_config.rst:1333 msgid "Default: ``1`` in Python config, ``0`` in isolated config." msgstr "" #: ../../c-api/init_config.rst:911 msgid "If equals to ``2``, coerce the C locale." msgstr "" #: ../../c-api/init_config.rst:913 msgid "" "If equals to ``1``, read the LC_CTYPE locale to decide if it should be " "coerced." msgstr "" #: ../../c-api/init_config.rst:918 ../../c-api/init_config.rst:924 msgid "Default: ``-1`` in Python config, ``0`` in isolated config." msgstr "" #: ../../c-api/init_config.rst:922 msgid "If non-zero, emit a warning if the C locale is coerced." msgstr "" #: ../../c-api/init_config.rst:928 msgid "" ":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." msgstr "" #: ../../c-api/init_config.rst:931 ../../c-api/init_config.rst:1342 #: ../../c-api/init_config.rst:1398 ../../c-api/init_config.rst:1892 msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" #: ../../c-api/init_config.rst:935 msgid "Isolated mode: see :c:member:`PyConfig.isolated`." msgstr "" #: ../../c-api/init_config.rst:937 ../../c-api/init_config.rst:1569 msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." msgstr "" #: ../../c-api/init_config.rst:941 msgid "If non-zero:" msgstr "" #: ../../c-api/init_config.rst:943 msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," msgstr "" #: ../../c-api/init_config.rst:944 msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," msgstr "" #: ../../c-api/init_config.rst:945 msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." msgstr "" #: ../../c-api/init_config.rst:947 msgid "" "Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable value." msgstr "" #: ../../c-api/init_config.rst:950 ../../c-api/init_config.rst:1583 msgid "" "Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " "Windows specific code." msgstr "" #: ../../c-api/init_config.rst:953 ../../c-api/init_config.rst:1281 #: ../../c-api/init_config.rst:1288 ../../c-api/init_config.rst:1355 #: ../../c-api/init_config.rst:1487 ../../c-api/init_config.rst:1505 #: ../../c-api/init_config.rst:1519 ../../c-api/init_config.rst:1586 #: ../../c-api/init_config.rst:1600 ../../c-api/init_config.rst:1660 #: ../../c-api/init_config.rst:1712 ../../c-api/init_config.rst:1774 #: ../../c-api/init_config.rst:1828 ../../c-api/init_config.rst:1857 #: ../../c-api/init_config.rst:1971 ../../c-api/init_config.rst:2018 msgid "Default: ``0``." msgstr "" #: ../../c-api/init_config.rst:957 msgid "" "If non-zero, :c:func:`Py_PreInitializeFromArgs` and " ":c:func:`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the " "same way the regular Python parses command line arguments: see :ref:`Command" " Line Arguments `." msgstr "" #: ../../c-api/init_config.rst:966 msgid "" "Use :ref:`environment variables `? See " ":c:member:`PyConfig.use_environment`." msgstr "" #: ../../c-api/init_config.rst:969 ../../c-api/init_config.rst:1933 msgid "Default: ``1`` in Python config and ``0`` in isolated config." msgstr "" #: ../../c-api/init_config.rst:973 msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." msgstr "" #: ../../c-api/init_config.rst:975 msgid "" "Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and " "the :envvar:`PYTHONUTF8` environment variable." msgstr "" #: ../../c-api/init_config.rst:978 msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." msgstr "" #: ../../c-api/init_config.rst:980 msgid "Default: ``-1`` in Python config and ``0`` in isolated config." msgstr "" #: ../../c-api/init_config.rst:986 msgid "Preinitialize Python with PyPreConfig" msgstr "" #: ../../c-api/init_config.rst:988 msgid "The preinitialization of Python:" msgstr "" #: ../../c-api/init_config.rst:990 msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" msgstr "" #: ../../c-api/init_config.rst:991 msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" msgstr "" #: ../../c-api/init_config.rst:992 msgid "" "Set the :ref:`Python UTF-8 Mode ` " "(:c:member:`PyPreConfig.utf8_mode`)" msgstr "" #: ../../c-api/init_config.rst:995 msgid "" "The current preconfiguration (``PyPreConfig`` type) is stored in " "``_PyRuntime.preconfig``." msgstr "" #: ../../c-api/init_config.rst:998 msgid "Functions to preinitialize Python:" msgstr "" #: ../../c-api/init_config.rst:1002 ../../c-api/init_config.rst:1008 #: ../../c-api/init_config.rst:1017 msgid "Preinitialize Python from *preconfig* preconfiguration." msgstr "" #: ../../c-api/init_config.rst:1004 ../../c-api/init_config.rst:1013 #: ../../c-api/init_config.rst:1022 msgid "*preconfig* must not be ``NULL``." msgstr "" #: ../../c-api/init_config.rst:1010 msgid "" "Parse *argv* command line arguments (bytes strings) if " ":c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" #: ../../c-api/init_config.rst:1019 msgid "" "Parse *argv* command line arguments (wide strings) if " ":c:member:`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" #: ../../c-api/init_config.rst:1024 ../../c-api/init_config.rst:2041 msgid "" "The caller is responsible to handle exceptions (error or exit) using " ":c:func:`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" #: ../../c-api/init_config.rst:1027 msgid "" "For :ref:`Python Configuration ` " "(:c:func:`PyPreConfig_InitPythonConfig`), if Python is initialized with " "command line arguments, the command line arguments must also be passed to " "preinitialize Python, since they have an effect on the pre-configuration " "like encodings. For example, the :option:`-X utf8 <-X>` command line option " "enables the :ref:`Python UTF-8 Mode `." msgstr "" #: ../../c-api/init_config.rst:1034 msgid "" "``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " "before :c:func:`Py_InitializeFromConfig` to install a custom memory " "allocator. It can be called before :c:func:`Py_PreInitialize` if " ":c:member:`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" #: ../../c-api/init_config.rst:1039 msgid "" "Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not " "be used before the Python preinitialization, whereas calling directly " "``malloc()`` and ``free()`` is always safe. :c:func:`Py_DecodeLocale` must " "not be called before the Python preinitialization." msgstr "" #: ../../c-api/init_config.rst:1044 msgid "" "Example using the preinitialization to enable the :ref:`Python UTF-8 Mode " "`::" msgstr "" #: ../../c-api/init_config.rst:1047 msgid "" "PyStatus status;\n" "PyPreConfig preconfig;\n" "PyPreConfig_InitPythonConfig(&preconfig);\n" "\n" "preconfig.utf8_mode = 1;\n" "\n" "status = Py_PreInitialize(&preconfig);\n" "if (PyStatus_Exception(status)) {\n" " Py_ExitStatusException(status);\n" "}\n" "\n" "/* at this point, Python speaks UTF-8 */\n" "\n" "Py_Initialize();\n" "/* ... use Python API here ... */\n" "Py_Finalize();" msgstr "" #: ../../c-api/init_config.rst:1066 msgid "PyConfig" msgstr "" #: ../../c-api/init_config.rst:1070 msgid "Structure containing most parameters to configure Python." msgstr "" #: ../../c-api/init_config.rst:1072 msgid "" "When done, the :c:func:`PyConfig_Clear` function must be used to release the" " configuration memory." msgstr "" #: ../../c-api/init_config.rst:1077 msgid "Structure methods:" msgstr "" #: ../../c-api/init_config.rst:1081 msgid "" "Initialize configuration with the :ref:`Python Configuration `." msgstr "" #: ../../c-api/init_config.rst:1086 msgid "" "Initialize configuration with the :ref:`Isolated Configuration `." msgstr "" #: ../../c-api/init_config.rst:1091 msgid "Copy the wide character string *str* into ``*config_str``." msgstr "" #: ../../c-api/init_config.rst:1093 ../../c-api/init_config.rst:1100 #: ../../c-api/init_config.rst:1107 ../../c-api/init_config.rst:1115 #: ../../c-api/init_config.rst:1121 ../../c-api/init_config.rst:1138 msgid ":ref:`Preinitialize Python ` if needed." msgstr "" #: ../../c-api/init_config.rst:1097 msgid "" "Decode *str* using :c:func:`Py_DecodeLocale` and set the result into " "``*config_str``." msgstr "" #: ../../c-api/init_config.rst:1104 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of wide character strings." msgstr "" #: ../../c-api/init_config.rst:1111 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of bytes strings. Decode bytes using " ":c:func:`Py_DecodeLocale`." msgstr "" #: ../../c-api/init_config.rst:1119 msgid "Set the list of wide strings *list* to *length* and *items*." msgstr "" #: ../../c-api/init_config.rst:1125 msgid "Read all Python configuration." msgstr "" #: ../../c-api/init_config.rst:1127 msgid "Fields which are already initialized are left unchanged." msgstr "" #: ../../c-api/init_config.rst:1129 msgid "" "Fields for :ref:`path configuration ` are no longer " "calculated or modified when calling this function, as of Python 3.11." msgstr "" #: ../../c-api/init_config.rst:1132 ../../c-api/init_config.rst:1689 msgid "" "The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` " "arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after " "arguments are parsed. Since Python arguments are stripped from " ":c:member:`PyConfig.argv`, parsing arguments twice would parse the " "application options as Python options." msgstr "" #: ../../c-api/init_config.rst:1140 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed once, " ":c:member:`PyConfig.parse_argv` is set to ``2`` after arguments are parsed, " "and arguments are only parsed if :c:member:`PyConfig.parse_argv` equals " "``1``." msgstr "" #: ../../c-api/init_config.rst:1146 msgid "" ":c:func:`PyConfig_Read` no longer calculates all paths, and so fields listed" " under :ref:`Python Path Configuration ` may no longer be " "updated until :c:func:`Py_InitializeFromConfig` is called." msgstr "" #: ../../c-api/init_config.rst:1154 msgid "Release configuration memory." msgstr "" #: ../../c-api/init_config.rst:1156 msgid "" "Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed." " In that case, the Python preinitialization configuration " "(:c:type:`PyPreConfig`) in based on the :c:type:`PyConfig`. If configuration" " fields which are in common with :c:type:`PyPreConfig` are tuned, they must " "be set before calling a :c:type:`PyConfig` method:" msgstr "" #: ../../c-api/init_config.rst:1162 msgid ":c:member:`PyConfig.dev_mode`" msgstr "" #: ../../c-api/init_config.rst:1163 msgid ":c:member:`PyConfig.isolated`" msgstr "" #: ../../c-api/init_config.rst:1164 msgid ":c:member:`PyConfig.parse_argv`" msgstr "" #: ../../c-api/init_config.rst:1165 msgid ":c:member:`PyConfig.use_environment`" msgstr "" #: ../../c-api/init_config.rst:1167 msgid "" "Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` " "is used, this method must be called before other methods, since the " "preinitialization configuration depends on command line arguments (if " ":c:member:`~PyConfig.parse_argv` is non-zero)." msgstr "" #: ../../c-api/init_config.rst:1172 msgid "" "The caller of these methods is responsible to handle exceptions (error or " "exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``." msgstr "" #: ../../c-api/init_config.rst:1185 msgid "" "Set :data:`sys.argv` command line arguments based on " ":c:member:`~PyConfig.argv`. These parameters are similar to those passed to" " the program's :c:func:`main` function with the difference that the first " "entry should refer to the script file to be executed rather than the " "executable hosting the Python interpreter. If there isn't a script that " "will be run, the first entry in :c:member:`~PyConfig.argv` can be an empty " "string." msgstr "" #: ../../c-api/init_config.rst:1193 msgid "" "Set :c:member:`~PyConfig.parse_argv` to ``1`` to parse " ":c:member:`~PyConfig.argv` the same way the regular Python parses Python " "command line arguments and then to strip Python arguments from " ":c:member:`~PyConfig.argv`." msgstr "" #: ../../c-api/init_config.rst:1198 msgid "" "If :c:member:`~PyConfig.argv` is empty, an empty string is added to ensure " "that :data:`sys.argv` always exists and is never empty." msgstr "" #: ../../c-api/init_config.rst:1201 ../../c-api/init_config.rst:1228 #: ../../c-api/init_config.rst:1242 ../../c-api/init_config.rst:1252 #: ../../c-api/init_config.rst:1363 ../../c-api/init_config.rst:1372 #: ../../c-api/init_config.rst:1383 ../../c-api/init_config.rst:1474 #: ../../c-api/init_config.rst:1630 ../../c-api/init_config.rst:1731 #: ../../c-api/init_config.rst:1750 ../../c-api/init_config.rst:1765 #: ../../c-api/init_config.rst:1782 ../../c-api/init_config.rst:1795 #: ../../c-api/init_config.rst:1803 ../../c-api/init_config.rst:1817 #: ../../c-api/init_config.rst:1920 msgid "Default: ``NULL``." msgstr "" #: ../../c-api/init_config.rst:1203 msgid "See also the :c:member:`~PyConfig.orig_argv` member." msgstr "" #: ../../c-api/init_config.rst:1207 msgid "" "If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to " ":data:`sys.path` at startup:" msgstr "" #: ../../c-api/init_config.rst:1210 msgid "" "If :c:member:`argv[0] ` is equal to ``L\"-m\"`` (``python -m " "module``), prepend the current working directory." msgstr "" #: ../../c-api/init_config.rst:1212 msgid "" "If running a script (``python script.py``), prepend the script's directory." " If it's a symbolic link, resolve symbolic links." msgstr "" #: ../../c-api/init_config.rst:1214 msgid "" "Otherwise (``python -c code`` and ``python``), prepend an empty string, " "which means the current working directory." msgstr "" #: ../../c-api/init_config.rst:1217 msgid "" "Set to ``1`` by the :option:`-P` command line option and the " ":envvar:`PYTHONSAFEPATH` environment variable." msgstr "" #: ../../c-api/init_config.rst:1220 msgid "Default: ``0`` in Python config, ``1`` in isolated config." msgstr "" #: ../../c-api/init_config.rst:1226 msgid ":data:`sys.base_exec_prefix`." msgstr "" #: ../../c-api/init_config.rst:1230 ../../c-api/init_config.rst:1244 #: ../../c-api/init_config.rst:1254 ../../c-api/init_config.rst:1374 #: ../../c-api/init_config.rst:1385 ../../c-api/init_config.rst:1647 #: ../../c-api/init_config.rst:1733 msgid "" "Part of the :ref:`Python Path Configuration ` output." msgstr "" #: ../../c-api/init_config.rst:1232 msgid "See also :c:member:`PyConfig.exec_prefix`." msgstr "" #: ../../c-api/init_config.rst:1236 msgid "Python base executable: :data:`sys._base_executable`." msgstr "" #: ../../c-api/init_config.rst:1238 msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." msgstr "" #: ../../c-api/init_config.rst:1240 msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." msgstr "" #: ../../c-api/init_config.rst:1246 msgid "See also :c:member:`PyConfig.executable`." msgstr "" #: ../../c-api/init_config.rst:1250 msgid ":data:`sys.base_prefix`." msgstr "" #: ../../c-api/init_config.rst:1256 msgid "See also :c:member:`PyConfig.prefix`." msgstr "" #: ../../c-api/init_config.rst:1260 msgid "" "If equals to ``0`` and :c:member:`~PyConfig.configure_c_stdio` is non-zero, " "disable buffering on the C streams stdout and stderr." msgstr "" #: ../../c-api/init_config.rst:1263 msgid "" "Set to ``0`` by the :option:`-u` command line option and the " ":envvar:`PYTHONUNBUFFERED` environment variable." msgstr "" #: ../../c-api/init_config.rst:1266 msgid "stdin is always opened in buffered mode." msgstr "" #: ../../c-api/init_config.rst:1268 ../../c-api/init_config.rst:1301 #: ../../c-api/init_config.rst:1845 ../../c-api/init_config.rst:2003 msgid "Default: ``1``." msgstr "" #: ../../c-api/init_config.rst:1272 msgid "" "If equals to ``1``, issue a warning when comparing :class:`bytes` or " ":class:`bytearray` with :class:`str`, or comparing :class:`bytes` with " ":class:`int`." msgstr "" #: ../../c-api/init_config.rst:1276 msgid "" "If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these" " cases." msgstr "" #: ../../c-api/init_config.rst:1279 msgid "Incremented by the :option:`-b` command line option." msgstr "" #: ../../c-api/init_config.rst:1285 msgid "" "If non-zero, emit a :exc:`EncodingWarning` warning when " ":class:`io.TextIOWrapper` uses its default encoding. See :ref:`io-encoding-" "warning` for details." msgstr "" #: ../../c-api/init_config.rst:1294 msgid "" "If equals to ``0``, disables the inclusion of the end line and column " "mappings in code objects. Also disables traceback printing carets to " "specific error locations." msgstr "" #: ../../c-api/init_config.rst:1298 msgid "" "Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable and " "by the :option:`-X no_debug_ranges <-X>` command line option." msgstr "" #: ../../c-api/init_config.rst:1307 msgid "" "Control the validation behavior of hash-based ``.pyc`` files: value of the " ":option:`--check-hash-based-pycs` command line option." msgstr "" #: ../../c-api/init_config.rst:1310 msgid "Valid values:" msgstr "" #: ../../c-api/init_config.rst:1312 msgid "" "``L\"always\"``: Hash the source file for invalidation regardless of value " "of the 'check_source' flag." msgstr "" #: ../../c-api/init_config.rst:1314 msgid "``L\"never\"``: Assume that hash-based pycs always are valid." msgstr "" #: ../../c-api/init_config.rst:1315 msgid "" "``L\"default\"``: The 'check_source' flag in hash-based pycs determines " "invalidation." msgstr "" #: ../../c-api/init_config.rst:1318 msgid "Default: ``L\"default\"``." msgstr "" #: ../../c-api/init_config.rst:1320 msgid "See also :pep:`552` \"Deterministic pycs\"." msgstr "" #: ../../c-api/init_config.rst:1324 msgid "If non-zero, configure C standard streams:" msgstr "" #: ../../c-api/init_config.rst:1326 msgid "" "On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." msgstr "" #: ../../c-api/init_config.rst:1328 msgid "" "If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of " "stdin, stdout and stderr streams." msgstr "" #: ../../c-api/init_config.rst:1330 msgid "" "If :c:member:`~PyConfig.interactive` is non-zero, enable stream buffering on" " stdin and stdout (only stdout on Windows)." msgstr "" #: ../../c-api/init_config.rst:1337 msgid "If non-zero, enable the :ref:`Python Development Mode `." msgstr "" #: ../../c-api/init_config.rst:1339 msgid "" "Set to ``1`` by the :option:`-X dev <-X>` option and the " ":envvar:`PYTHONDEVMODE` environment variable." msgstr "" #: ../../c-api/init_config.rst:1346 msgid "Dump Python references?" msgstr "" #: ../../c-api/init_config.rst:1348 msgid "If non-zero, dump all objects which are still alive at exit." msgstr "" #: ../../c-api/init_config.rst:1350 msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable." msgstr "" #: ../../c-api/init_config.rst:1352 msgid "" "Needs a special build of Python with the ``Py_TRACE_REFS`` macro defined: " "see the :option:`configure --with-trace-refs option <--with-trace-refs>`." msgstr "" #: ../../c-api/init_config.rst:1359 msgid "Filename where to dump Python references." msgstr "" #: ../../c-api/init_config.rst:1361 msgid "Set by the :envvar:`PYTHONDUMPREFSFILE` environment variable." msgstr "" #: ../../c-api/init_config.rst:1369 msgid "" "The site-specific directory prefix where the platform-dependent Python files" " are installed: :data:`sys.exec_prefix`." msgstr "" #: ../../c-api/init_config.rst:1376 msgid "See also :c:member:`PyConfig.base_exec_prefix`." msgstr "" #: ../../c-api/init_config.rst:1380 msgid "" "The absolute path of the executable binary for the Python interpreter: " ":data:`sys.executable`." msgstr "" #: ../../c-api/init_config.rst:1387 msgid "See also :c:member:`PyConfig.base_executable`." msgstr "" #: ../../c-api/init_config.rst:1391 msgid "Enable faulthandler?" msgstr "" #: ../../c-api/init_config.rst:1393 msgid "If non-zero, call :func:`faulthandler.enable` at startup." msgstr "" #: ../../c-api/init_config.rst:1395 msgid "" "Set to ``1`` by :option:`-X faulthandler <-X>` and the " ":envvar:`PYTHONFAULTHANDLER` environment variable." msgstr "" #: ../../c-api/init_config.rst:1402 msgid "" ":term:`Filesystem encoding `: " ":func:`sys.getfilesystemencoding`." msgstr "" #: ../../c-api/init_config.rst:1405 msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default." msgstr "" #: ../../c-api/init_config.rst:1407 msgid "" "On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` if " ":c:member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig`" " is non-zero." msgstr "" #: ../../c-api/init_config.rst:1411 msgid "Default encoding on other platforms:" msgstr "" #: ../../c-api/init_config.rst:1413 msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" #: ../../c-api/init_config.rst:1414 msgid "" "``\"ascii\"`` if Python detects that ``nl_langinfo(CODESET)`` announces the " "ASCII encoding, whereas the ``mbstowcs()`` function decodes from a different" " encoding (usually Latin1)." msgstr "" #: ../../c-api/init_config.rst:1417 msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." msgstr "" #: ../../c-api/init_config.rst:1418 msgid "" "Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." msgstr "" #: ../../c-api/init_config.rst:1421 msgid "" "At Python startup, the encoding name is normalized to the Python codec name." " For example, ``\"ANSI_X3.4-1968\"`` is replaced with ``\"ascii\"``." msgstr "" #: ../../c-api/init_config.rst:1424 msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." msgstr "" #: ../../c-api/init_config.rst:1428 msgid "" ":term:`Filesystem error handler `: " ":func:`sys.getfilesystemencodeerrors`." msgstr "" #: ../../c-api/init_config.rst:1431 msgid "" "On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if " ":c:member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig`" " is non-zero." msgstr "" #: ../../c-api/init_config.rst:1435 msgid "On other platforms: use ``\"surrogateescape\"`` by default." msgstr "" #: ../../c-api/init_config.rst:1437 msgid "Supported error handlers:" msgstr "" #: ../../c-api/init_config.rst:1439 msgid "``\"strict\"``" msgstr "" #: ../../c-api/init_config.rst:1440 msgid "``\"surrogateescape\"``" msgstr "" #: ../../c-api/init_config.rst:1441 msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" msgstr "" #: ../../c-api/init_config.rst:1443 msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." msgstr "" #: ../../c-api/init_config.rst:1447 msgid "If non-zero, use frozen modules." msgstr "" #: ../../c-api/init_config.rst:1449 msgid "Set by the :envvar:`PYTHON_FROZEN_MODULES` environment variable." msgstr "" #: ../../c-api/init_config.rst:1451 msgid "" "Default: ``1`` in a release build, or ``0`` in a :ref:`debug build `." msgstr "" #: ../../c-api/init_config.rst:1457 msgid "Randomized hash function seed." msgstr "" #: ../../c-api/init_config.rst:1459 msgid "" "If :c:member:`~PyConfig.use_hash_seed` is zero, a seed is chosen randomly at" " Python startup, and :c:member:`~PyConfig.hash_seed` is ignored." msgstr "" #: ../../c-api/init_config.rst:1462 msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." msgstr "" #: ../../c-api/init_config.rst:1464 msgid "" "Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated " "mode." msgstr "" #: ../../c-api/init_config.rst:1469 msgid "" "Set the default Python \"home\" directory, that is, the location of the " "standard Python libraries (see :envvar:`PYTHONHOME`)." msgstr "" #: ../../c-api/init_config.rst:1472 msgid "Set by the :envvar:`PYTHONHOME` environment variable." msgstr "" #: ../../c-api/init_config.rst:1476 ../../c-api/init_config.rst:1612 #: ../../c-api/init_config.rst:1632 ../../c-api/init_config.rst:1721 #: ../../c-api/init_config.rst:1752 msgid "Part of the :ref:`Python Path Configuration ` input." msgstr "" #: ../../c-api/init_config.rst:1480 msgid "" "If ``1``, profile import time. If ``2``, include additional output that " "indicates when an imported module has already been loaded." msgstr "" #: ../../c-api/init_config.rst:1484 msgid "" "Set by the :option:`-X importtime <-X>` option and the " ":envvar:`PYTHONPROFILEIMPORTTIME` environment variable." msgstr "" #: ../../c-api/init_config.rst:1491 msgid "Added support for ``import_time = 2``" msgstr "" #: ../../c-api/init_config.rst:1495 msgid "Enter interactive mode after executing a script or a command." msgstr "" #: ../../c-api/init_config.rst:1497 msgid "" "If greater than ``0``, enable inspect: when a script is passed as first " "argument or the -c option is used, enter interactive mode after executing " "the script or the command, even when :data:`sys.stdin` does not appear to be" " a terminal." msgstr "" #: ../../c-api/init_config.rst:1502 msgid "" "Incremented by the :option:`-i` command line option. Set to ``1`` if the " ":envvar:`PYTHONINSPECT` environment variable is non-empty." msgstr "" #: ../../c-api/init_config.rst:1509 msgid "Install Python signal handlers?" msgstr "" #: ../../c-api/init_config.rst:1511 ../../c-api/init_config.rst:1695 #: ../../c-api/init_config.rst:1719 ../../c-api/init_config.rst:1955 msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." msgstr "" #: ../../c-api/init_config.rst:1515 msgid "If greater than ``0``, enable the interactive mode (REPL)." msgstr "" #: ../../c-api/init_config.rst:1517 msgid "Incremented by the :option:`-i` command line option." msgstr "" #: ../../c-api/init_config.rst:1523 msgid "" "Configures the :ref:`integer string conversion length limitation " "`. An initial value of ``-1`` means the value will be " "taken from the command line or environment or otherwise default to 4300 " "(:data:`sys.int_info.default_max_str_digits`). A value of ``0`` disables " "the limitation. Values greater than zero but less than 640 " "(:data:`sys.int_info.str_digits_check_threshold`) are unsupported and will " "produce an error." msgstr "" #: ../../c-api/init_config.rst:1531 msgid "" "Configured by the :option:`-X int_max_str_digits <-X>` command line flag or " "the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." msgstr "" #: ../../c-api/init_config.rst:1534 msgid "" "Default: ``-1`` in Python mode. 4300 " "(:data:`sys.int_info.default_max_str_digits`) in isolated mode." msgstr "" #: ../../c-api/init_config.rst:1541 msgid "" "If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will " "override the return values of :func:`os.cpu_count`, " ":func:`os.process_cpu_count`, and :func:`multiprocessing.cpu_count`." msgstr "" #: ../../c-api/init_config.rst:1545 msgid "" "Configured by the :samp:`-X cpu_count={n|default}` command line flag or the " ":envvar:`PYTHON_CPU_COUNT` environment variable." msgstr "" #: ../../c-api/init_config.rst:1548 ../../c-api/init_config.rst:1909 msgid "Default: ``-1``." msgstr "" #: ../../c-api/init_config.rst:1554 msgid "If greater than ``0``, enable isolated mode:" msgstr "" #: ../../c-api/init_config.rst:1556 msgid "" "Set :c:member:`~PyConfig.safe_path` to ``1``: don't prepend a potentially " "unsafe path to :data:`sys.path` at Python startup, such as the current " "directory, the script's directory or an empty string." msgstr "" #: ../../c-api/init_config.rst:1560 msgid "" "Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " "environment variables." msgstr "" #: ../../c-api/init_config.rst:1562 msgid "" "Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user " "site directory to :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:1564 msgid "" "Python REPL doesn't import :mod:`readline` nor enable default readline " "configuration on interactive prompts." msgstr "" #: ../../c-api/init_config.rst:1567 msgid "Set to ``1`` by the :option:`-I` command line option." msgstr "" #: ../../c-api/init_config.rst:1571 msgid "" "See also the :ref:`Isolated Configuration ` and " ":c:member:`PyPreConfig.isolated`." msgstr "" #: ../../c-api/init_config.rst:1576 msgid "" "If non-zero, use :class:`io.FileIO` instead of " ":class:`!io._WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and" " :data:`sys.stderr`." msgstr "" #: ../../c-api/init_config.rst:1580 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" #: ../../c-api/init_config.rst:1588 msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." msgstr "" #: ../../c-api/init_config.rst:1592 msgid "" "If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " "` at exit." msgstr "" #: ../../c-api/init_config.rst:1595 msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." msgstr "" #: ../../c-api/init_config.rst:1597 msgid "" "The option is ignored if Python is :option:`configured using the --without-" "pymalloc option <--without-pymalloc>`." msgstr "" #: ../../c-api/init_config.rst:1604 msgid "Platform library directory name: :data:`sys.platlibdir`." msgstr "" #: ../../c-api/init_config.rst:1606 msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." msgstr "" #: ../../c-api/init_config.rst:1608 msgid "" "Default: value of the ``PLATLIBDIR`` macro which is set by the " ":option:`configure --with-platlibdir option <--with-platlibdir>` (default: " "``\"lib\"``, or ``\"DLLs\"`` on Windows)." msgstr "" #: ../../c-api/init_config.rst:1616 msgid "" "This macro is now used on Windows to locate the standard library extension " "modules, typically under ``DLLs``. However, for compatibility, note that " "this value is ignored for any non-standard layouts, including in-tree builds" " and virtual environments." msgstr "" #: ../../c-api/init_config.rst:1625 msgid "" "Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` " "(:data:`os.pathsep`)." msgstr "" #: ../../c-api/init_config.rst:1628 msgid "Set by the :envvar:`PYTHONPATH` environment variable." msgstr "" #: ../../c-api/init_config.rst:1637 msgid "Module search paths: :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:1639 msgid "" "If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, " ":c:func:`Py_InitializeFromConfig` will replace " ":c:member:`~PyConfig.module_search_paths` and sets " ":c:member:`~PyConfig.module_search_paths_set` to ``1``." msgstr "" #: ../../c-api/init_config.rst:1644 msgid "" "Default: empty list (``module_search_paths``) and ``0`` " "(``module_search_paths_set``)." msgstr "" #: ../../c-api/init_config.rst:1651 msgid "Compilation optimization level:" msgstr "" #: ../../c-api/init_config.rst:1653 msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." msgstr "" #: ../../c-api/init_config.rst:1654 msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." msgstr "" #: ../../c-api/init_config.rst:1655 msgid "``2``: Level 1, strip docstrings." msgstr "" #: ../../c-api/init_config.rst:1657 msgid "" "Incremented by the :option:`-O` command line option. Set to the " ":envvar:`PYTHONOPTIMIZE` environment variable value." msgstr "" #: ../../c-api/init_config.rst:1664 msgid "" "The list of the original command line arguments passed to the Python " "executable: :data:`sys.orig_argv`." msgstr "" #: ../../c-api/init_config.rst:1667 msgid "" "If :c:member:`~PyConfig.orig_argv` list is empty and " ":c:member:`~PyConfig.argv` is not a list only containing an empty string, " ":c:func:`PyConfig_Read` copies :c:member:`~PyConfig.argv` into " ":c:member:`~PyConfig.orig_argv` before modifying :c:member:`~PyConfig.argv` " "(if :c:member:`~PyConfig.parse_argv` is non-zero)." msgstr "" #: ../../c-api/init_config.rst:1674 msgid "" "See also the :c:member:`~PyConfig.argv` member and the " ":c:func:`Py_GetArgcArgv` function." msgstr "" #: ../../c-api/init_config.rst:1677 ../../c-api/init_config.rst:1990 #: ../../c-api/init_config.rst:2009 msgid "Default: empty list." msgstr "" #: ../../c-api/init_config.rst:1683 msgid "Parse command line arguments?" msgstr "" #: ../../c-api/init_config.rst:1685 msgid "" "If equals to ``1``, parse :c:member:`~PyConfig.argv` the same way the " "regular Python parses :ref:`command line arguments `, and " "strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" #: ../../c-api/init_config.rst:1697 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed if " ":c:member:`PyConfig.parse_argv` equals to ``1``." msgstr "" #: ../../c-api/init_config.rst:1703 msgid "" "Parser debug mode. If greater than ``0``, turn on parser debugging output " "(for expert only, depending on compilation options)." msgstr "" #: ../../c-api/init_config.rst:1706 msgid "" "Incremented by the :option:`-d` command line option. Set to the " ":envvar:`PYTHONDEBUG` environment variable value." msgstr "" #: ../../c-api/init_config.rst:1709 ../../c-api/init_config.rst:1814 msgid "" "Needs a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " "must be defined)." msgstr "" #: ../../c-api/init_config.rst:1716 msgid "" "If non-zero, calculation of path configuration is allowed to log warnings " "into ``stderr``. If equals to ``0``, suppress these warnings." msgstr "" #: ../../c-api/init_config.rst:1723 msgid "Now also applies on Windows." msgstr "" #: ../../c-api/init_config.rst:1728 msgid "" "The site-specific directory prefix where the platform independent Python " "files are installed: :data:`sys.prefix`." msgstr "" #: ../../c-api/init_config.rst:1735 msgid "See also :c:member:`PyConfig.base_prefix`." msgstr "" #: ../../c-api/init_config.rst:1739 msgid "" "Program name used to initialize :c:member:`~PyConfig.executable` and in " "early error messages during Python initialization." msgstr "" #: ../../c-api/init_config.rst:1742 msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." msgstr "" #: ../../c-api/init_config.rst:1743 msgid "" "If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use " ":envvar:`__PYVENV_LAUNCHER__` environment variable if set." msgstr "" #: ../../c-api/init_config.rst:1745 msgid "" "Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." msgstr "" #: ../../c-api/init_config.rst:1747 msgid "" "Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " "platforms." msgstr "" #: ../../c-api/init_config.rst:1756 msgid "" "Directory where cached ``.pyc`` files are written: " ":data:`sys.pycache_prefix`." msgstr "" #: ../../c-api/init_config.rst:1759 msgid "" "Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and the" " :envvar:`PYTHONPYCACHEPREFIX` environment variable. The command-line option" " takes precedence." msgstr "" #: ../../c-api/init_config.rst:1763 msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." msgstr "" #: ../../c-api/init_config.rst:1769 msgid "" "Quiet mode. If greater than ``0``, don't display the copyright and version " "at Python startup in interactive mode." msgstr "" #: ../../c-api/init_config.rst:1772 msgid "Incremented by the :option:`-q` command line option." msgstr "" #: ../../c-api/init_config.rst:1778 msgid "Value of the :option:`-c` command line option." msgstr "" #: ../../c-api/init_config.rst:1780 ../../c-api/init_config.rst:1801 msgid "Used by :c:func:`Py_RunMain`." msgstr "" #: ../../c-api/init_config.rst:1786 msgid "" "Filename passed on the command line: trailing command line argument without " ":option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` " "function." msgstr "" #: ../../c-api/init_config.rst:1790 msgid "" "For example, it is set to ``script.py`` by the ``python3 script.py arg`` " "command line." msgstr "" #: ../../c-api/init_config.rst:1793 msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." msgstr "" #: ../../c-api/init_config.rst:1799 msgid "Value of the :option:`-m` command line option." msgstr "" #: ../../c-api/init_config.rst:1807 msgid "" "``package.module`` path to module that should be imported before ``site.py``" " is run." msgstr "" #: ../../c-api/init_config.rst:1810 msgid "" "Set by the :option:`-X presite=package.module <-X>` command-line option and " "the :envvar:`PYTHON_PRESITE` environment variable. The command-line option " "takes precedence." msgstr "" #: ../../c-api/init_config.rst:1821 msgid "" "Show total reference count at exit (excluding :term:`immortal` objects)?" msgstr "" #: ../../c-api/init_config.rst:1823 msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." msgstr "" #: ../../c-api/init_config.rst:1825 msgid "" "Needs a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " "macro must be defined)." msgstr "" #: ../../c-api/init_config.rst:1832 msgid "Import the :mod:`site` module at startup?" msgstr "" #: ../../c-api/init_config.rst:1834 msgid "" "If equal to zero, disable the import of the module site and the site-" "dependent manipulations of :data:`sys.path` that it entails." msgstr "" #: ../../c-api/init_config.rst:1837 msgid "" "Also disable these manipulations if the :mod:`site` module is explicitly " "imported later (call :func:`site.main` if you want them to be triggered)." msgstr "" #: ../../c-api/init_config.rst:1840 msgid "Set to ``0`` by the :option:`-S` command line option." msgstr "" #: ../../c-api/init_config.rst:1842 msgid "" ":data:`sys.flags.no_site ` is set to the inverted value of " ":c:member:`~PyConfig.site_import`." msgstr "" #: ../../c-api/init_config.rst:1849 msgid "" "If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " "source." msgstr "" #: ../../c-api/init_config.rst:1852 msgid "" "It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a " "DOS specific hack only." msgstr "" #: ../../c-api/init_config.rst:1855 msgid "Set to ``1`` by the :option:`-x` command line option." msgstr "" #: ../../c-api/init_config.rst:1862 msgid "" "Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and " ":data:`sys.stderr` (but :data:`sys.stderr` always uses " "``\"backslashreplace\"`` error handler)." msgstr "" #: ../../c-api/init_config.rst:1866 msgid "" "Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." msgstr "" #: ../../c-api/init_config.rst:1869 msgid "Default encoding:" msgstr "" #: ../../c-api/init_config.rst:1871 msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" #: ../../c-api/init_config.rst:1872 msgid "Otherwise, use the :term:`locale encoding`." msgstr "" #: ../../c-api/init_config.rst:1874 msgid "Default error handler:" msgstr "" #: ../../c-api/init_config.rst:1876 msgid "On Windows: use ``\"surrogateescape\"``." msgstr "" #: ../../c-api/init_config.rst:1877 msgid "" "``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or" " if the LC_CTYPE locale is \"C\" or \"POSIX\"." msgstr "" #: ../../c-api/init_config.rst:1879 msgid "``\"strict\"`` otherwise." msgstr "" #: ../../c-api/init_config.rst:1881 msgid "See also :c:member:`PyConfig.legacy_windows_stdio`." msgstr "" #: ../../c-api/init_config.rst:1885 msgid "Enable tracemalloc?" msgstr "" #: ../../c-api/init_config.rst:1887 msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" #: ../../c-api/init_config.rst:1889 msgid "" "Set by :option:`-X tracemalloc=N <-X>` command line option and by the " ":envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" #: ../../c-api/init_config.rst:1896 msgid "Enable the Linux ``perf`` profiler support?" msgstr "" #: ../../c-api/init_config.rst:1898 msgid "If equals to ``1``, enable support for the Linux ``perf`` profiler." msgstr "" #: ../../c-api/init_config.rst:1900 msgid "" "If equals to ``2``, enable support for the Linux ``perf`` profiler with " "DWARF JIT support." msgstr "" #: ../../c-api/init_config.rst:1903 msgid "" "Set to ``1`` by :option:`-X perf <-X>` command-line option and the " ":envvar:`PYTHONPERFSUPPORT` environment variable." msgstr "" #: ../../c-api/init_config.rst:1906 msgid "" "Set to ``2`` by the :option:`-X perf_jit <-X>` command-line option and the " ":envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable." msgstr "" #: ../../c-api/init_config.rst:1912 msgid "See :ref:`perf_profiling` for more information." msgstr "" #: ../../c-api/init_config.rst:1918 msgid "Directory of the Python standard library." msgstr "" #: ../../c-api/init_config.rst:1926 msgid "Use :ref:`environment variables `?" msgstr "" #: ../../c-api/init_config.rst:1928 msgid "" "If equals to zero, ignore the :ref:`environment variables `." msgstr "" #: ../../c-api/init_config.rst:1931 msgid "Set to ``0`` by the :option:`-E` environment variable." msgstr "" #: ../../c-api/init_config.rst:1937 msgid "" "If non-zero, ``stdout`` and ``stderr`` will be redirected to the system log." msgstr "" #: ../../c-api/init_config.rst:1940 msgid "Only available on macOS 10.12 and later, and on iOS." msgstr "" #: ../../c-api/init_config.rst:1942 msgid "" "Default: ``0`` (don't use the system log) on macOS; ``1`` on iOS (use the " "system log)." msgstr "" #: ../../c-api/init_config.rst:1949 msgid "If non-zero, add the user site directory to :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:1951 msgid "" "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." msgstr "" #: ../../c-api/init_config.rst:1953 msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" #: ../../c-api/init_config.rst:1959 msgid "" "Verbose mode. If greater than ``0``, print a message each time a module is " "imported, showing the place (filename or built-in module) from which it is " "loaded." msgstr "" #: ../../c-api/init_config.rst:1963 msgid "" "If greater than or equal to ``2``, print a message for each file that is " "checked for when searching for a module. Also provides information on module" " cleanup at exit." msgstr "" #: ../../c-api/init_config.rst:1967 msgid "Incremented by the :option:`-v` command line option." msgstr "" #: ../../c-api/init_config.rst:1969 msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." msgstr "" #: ../../c-api/init_config.rst:1975 msgid "" "Options of the :mod:`warnings` module to build warnings filters, lowest to " "highest priority: :data:`sys.warnoptions`." msgstr "" #: ../../c-api/init_config.rst:1978 msgid "" "The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse " "order: the last :c:member:`PyConfig.warnoptions` item becomes the first item" " of :data:`warnings.filters` which is checked first (highest priority)." msgstr "" #: ../../c-api/init_config.rst:1983 msgid "" "The :option:`-W` command line options adds its value to " ":c:member:`~PyConfig.warnoptions`, it can be used multiple times." msgstr "" #: ../../c-api/init_config.rst:1986 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " "warning options. Multiple options can be specified, separated by commas " "(``,``)." msgstr "" #: ../../c-api/init_config.rst:1994 msgid "" "If equal to ``0``, Python won't try to write ``.pyc`` files on the import of" " source modules." msgstr "" #: ../../c-api/init_config.rst:1997 msgid "" "Set to ``0`` by the :option:`-B` command line option and the " ":envvar:`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" #: ../../c-api/init_config.rst:2000 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of " ":c:member:`~PyConfig.write_bytecode`." msgstr "" #: ../../c-api/init_config.rst:2007 msgid "" "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" #: ../../c-api/init_config.rst:2013 msgid "If non-zero, write performance statistics at Python exit." msgstr "" #: ../../c-api/init_config.rst:2015 msgid "" "Need a special build with the ``Py_STATS`` macro: see :option:`--enable-" "pystats`." msgstr "" #: ../../c-api/init_config.rst:2020 msgid "" "If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` " "arguments are parsed the same way the regular Python parses :ref:`command " "line arguments `, and Python arguments are stripped from " ":c:member:`~PyConfig.argv`." msgstr "" #: ../../c-api/init_config.rst:2025 msgid "" "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " "see the :option:`-X` command line option." msgstr "" #: ../../c-api/init_config.rst:2030 msgid "The ``show_alloc_count`` field has been removed." msgstr "" #: ../../c-api/init_config.rst:2036 msgid "Initialization with PyConfig" msgstr "" #: ../../c-api/init_config.rst:2038 msgid "" "Initializing the interpreter from a populated configuration struct is " "handled by calling :c:func:`Py_InitializeFromConfig`." msgstr "" #: ../../c-api/init_config.rst:2044 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or " ":c:func:`PyImport_ExtendInittab` are used, they must be set or called after " "Python preinitialization and before the Python initialization. If Python is " "initialized multiple times, :c:func:`PyImport_AppendInittab` or " ":c:func:`PyImport_ExtendInittab` must be called before each Python " "initialization." msgstr "" #: ../../c-api/init_config.rst:2051 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" #: ../../c-api/init_config.rst:2054 msgid "Example setting the program name::" msgstr "" #: ../../c-api/init_config.rst:2056 msgid "" "void init_python(void)\n" "{\n" " PyStatus status;\n" "\n" " PyConfig config;\n" " PyConfig_InitPythonConfig(&config);\n" "\n" " /* Set the program name. Implicitly preinitialize Python. */\n" " status = PyConfig_SetString(&config, &config.program_name,\n" " L\"/path/to/my_program\");\n" " if (PyStatus_Exception(status)) {\n" " goto exception;\n" " }\n" "\n" " status = Py_InitializeFromConfig(&config);\n" " if (PyStatus_Exception(status)) {\n" " goto exception;\n" " }\n" " PyConfig_Clear(&config);\n" " return;\n" "\n" "exception:\n" " PyConfig_Clear(&config);\n" " Py_ExitStatusException(status);\n" "}" msgstr "" #: ../../c-api/init_config.rst:2082 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many" " parameters are not calculated until initialization, and so values cannot be" " read from the configuration structure. Any values set before initialize is " "called will be left unchanged by initialization::" msgstr "" #: ../../c-api/init_config.rst:2089 msgid "" "PyStatus init_python(const char *program_name)\n" "{\n" " PyStatus status;\n" "\n" " PyConfig config;\n" " PyConfig_InitPythonConfig(&config);\n" "\n" " /* Set the program name before reading the configuration\n" " (decode byte string from the locale encoding).\n" "\n" " Implicitly preinitialize Python. */\n" " status = PyConfig_SetBytesString(&config, &config.program_name,\n" " program_name);\n" " if (PyStatus_Exception(status)) {\n" " goto done;\n" " }\n" "\n" " /* Read all configuration at once */\n" " status = PyConfig_Read(&config);\n" " if (PyStatus_Exception(status)) {\n" " goto done;\n" " }\n" "\n" " /* Specify sys.path explicitly */\n" " /* If you want to modify the default set of paths, finish\n" " initialization first and then use PySys_GetObject(\"path\") */\n" " config.module_search_paths_set = 1;\n" " status = PyWideStringList_Append(&config.module_search_paths,\n" " L\"/path/to/stdlib\");\n" " if (PyStatus_Exception(status)) {\n" " goto done;\n" " }\n" " status = PyWideStringList_Append(&config.module_search_paths,\n" " L\"/path/to/more/modules\");\n" " if (PyStatus_Exception(status)) {\n" " goto done;\n" " }\n" "\n" " /* Override executable computed by PyConfig_Read() */\n" " status = PyConfig_SetString(&config, &config.executable,\n" " L\"/path/to/my_executable\");\n" " if (PyStatus_Exception(status)) {\n" " goto done;\n" " }\n" "\n" " status = Py_InitializeFromConfig(&config);\n" "\n" "done:\n" " PyConfig_Clear(&config);\n" " return status;\n" "}" msgstr "" #: ../../c-api/init_config.rst:2145 msgid "Isolated Configuration" msgstr "" #: ../../c-api/init_config.rst:2147 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and " ":c:func:`PyConfig_InitIsolatedConfig` functions create a configuration to " "isolate Python from the system. For example, to embed Python into an " "application." msgstr "" #: ../../c-api/init_config.rst:2152 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " "and user site directory. The C standard streams (ex: ``stdout``) and the " "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" #: ../../c-api/init_config.rst:2157 msgid "" "Configuration files are still used with this configuration to determine " "paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to" " avoid computing the default path configuration." msgstr "" #: ../../c-api/init_config.rst:2165 msgid "Python Configuration" msgstr "" #: ../../c-api/init_config.rst:2167 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and " ":c:func:`PyConfig_InitPythonConfig` functions create a configuration to " "build a customized Python which behaves as the regular Python." msgstr "" #: ../../c-api/init_config.rst:2171 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" #: ../../c-api/init_config.rst:2174 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " "Mode ` (:pep:`540`) depending on the LC_CTYPE locale, " ":envvar:`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment " "variables." msgstr "" #: ../../c-api/init_config.rst:2183 msgid "Python Path Configuration" msgstr "" #: ../../c-api/init_config.rst:2185 msgid "" ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" #: ../../c-api/init_config.rst:2187 msgid "Path configuration inputs:" msgstr "" #: ../../c-api/init_config.rst:2189 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" #: ../../c-api/init_config.rst:2190 msgid ":c:member:`PyConfig.platlibdir`" msgstr "" #: ../../c-api/init_config.rst:2191 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" #: ../../c-api/init_config.rst:2192 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" #: ../../c-api/init_config.rst:2193 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" #: ../../c-api/init_config.rst:2194 msgid "current working directory: to get absolute paths" msgstr "" #: ../../c-api/init_config.rst:2195 msgid "" "``PATH`` environment variable to get the program full path (from " ":c:member:`PyConfig.program_name`)" msgstr "" #: ../../c-api/init_config.rst:2197 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "" #: ../../c-api/init_config.rst:2198 msgid "" "(Windows only) Application paths in the registry under " "\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and " "HKEY_LOCAL_MACHINE (where X.Y is the Python version)." msgstr "" #: ../../c-api/init_config.rst:2202 msgid "Path configuration output fields:" msgstr "" #: ../../c-api/init_config.rst:2204 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" #: ../../c-api/init_config.rst:2205 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" #: ../../c-api/init_config.rst:2206 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" #: ../../c-api/init_config.rst:2207 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" #: ../../c-api/init_config.rst:2208 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" #: ../../c-api/init_config.rst:2209 msgid "" ":c:member:`PyConfig.module_search_paths_set`, " ":c:member:`PyConfig.module_search_paths`" msgstr "" #: ../../c-api/init_config.rst:2211 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" #: ../../c-api/init_config.rst:2213 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If " ":c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, " ":c:member:`~PyConfig.module_search_paths` is overridden and " ":c:member:`~PyConfig.module_search_paths_set` is set to ``1``." msgstr "" #: ../../c-api/init_config.rst:2219 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " "fields listed above. A string is considered as set even if it is non-empty. " "``module_search_paths`` is considered as set if ``module_search_paths_set`` " "is set to ``1``. In this case, ``module_search_paths`` will be used without " "modification." msgstr "" #: ../../c-api/init_config.rst:2226 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " "when calculating the path configuration (Unix only, Windows does not log any" " warning)." msgstr "" #: ../../c-api/init_config.rst:2229 msgid "" "If :c:member:`~PyConfig.base_prefix` or " ":c:member:`~PyConfig.base_exec_prefix` fields are not set, they inherit " "their value from :c:member:`~PyConfig.prefix` and " ":c:member:`~PyConfig.exec_prefix` respectively." msgstr "" #: ../../c-api/init_config.rst:2233 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" #: ../../c-api/init_config.rst:2235 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend " ":c:member:`~PyConfig.run_filename` to :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:2238 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" #: ../../c-api/init_config.rst:2240 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory to" " :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" #: ../../c-api/init_config.rst:2242 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:2244 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:2246 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If " ":c:member:`~PyConfig.user_site_directory` is non-zero and the user's site-" "package directory exists, the :mod:`site` module appends the user's site-" "package directory to :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:2252 msgid "The following configuration files are used by the path configuration:" msgstr "" #: ../../c-api/init_config.rst:2254 msgid "``pyvenv.cfg``" msgstr "" #: ../../c-api/init_config.rst:2255 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" #: ../../c-api/init_config.rst:2256 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" #: ../../c-api/init_config.rst:2258 msgid "If a ``._pth`` file is present:" msgstr "" #: ../../c-api/init_config.rst:2260 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "" #: ../../c-api/init_config.rst:2261 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "" #: ../../c-api/init_config.rst:2262 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "" #: ../../c-api/init_config.rst:2263 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "" #: ../../c-api/init_config.rst:2265 msgid "" "If :c:member:`~PyConfig.home` is not set and a ``pyvenv.cfg`` file is " "present in the same directory as :c:member:`~PyConfig.executable`, or its " "parent, :c:member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` " "are set that location. When this happens, :c:member:`~PyConfig.base_prefix` " "and :c:member:`~PyConfig.base_exec_prefix` still keep their value, pointing " "to the base installation. See :ref:`sys-path-init-virtual-environments` for " "more information." msgstr "" #: ../../c-api/init_config.rst:2273 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set " ":c:member:`PyConfig.base_executable`." msgstr "" #: ../../c-api/init_config.rst:2278 msgid "" ":c:member:`~PyConfig.prefix`, and :c:member:`~PyConfig.exec_prefix`, are now" " set to the ``pyvenv.cfg`` directory. This was previously done by " ":mod:`site`, therefore affected by :option:`-S`." msgstr "" #: ../../c-api/init_config.rst:2284 msgid "Py_GetArgcArgv()" msgstr "" #: ../../c-api/init_config.rst:2288 msgid "Get the original command line arguments, before Python modified them." msgstr "" #: ../../c-api/init_config.rst:2290 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" #: ../../c-api/init_config.rst:2293 msgid "Delaying main module execution" msgstr "" #: ../../c-api/init_config.rst:2295 msgid "" "In some embedding use cases, it may be desirable to separate interpreter " "initialization from the execution of the main module." msgstr "" #: ../../c-api/init_config.rst:2298 msgid "" "This separation can be achieved by setting ``PyConfig.run_command`` to the " "empty string during initialization (to prevent the interpreter from dropping" " into the interactive prompt), and then subsequently executing the desired " "main module code using ``__main__.__dict__`` as the global namespace." msgstr "" #: ../../c-api/init_config.rst:1181 msgid "main()" msgstr "" #: ../../c-api/init_config.rst:1181 msgid "argv (in module sys)" msgstr ""