# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2026, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: # python-doc bot, 2025 # Gustavo Reis, 2025 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2026-02-17 15:27+0000\n" "PO-Revision-Date: 2025-09-15 01:03+0000\n" "Last-Translator: Gustavo Reis, 2025\n" "Language-Team: Portuguese (Brazil) (https://app.transifex.com/python-doc/" "teams/5390/pt_BR/)\n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % " "1000000 == 0 ? 1 : 2;\n" #: ../../c-api/init_config.rst:7 msgid "Python Initialization Configuration" msgstr "Configuração de inicialização do Python" #: ../../c-api/init_config.rst:11 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 "" "Python pode ser inicializado com :c:func:`Py_InitializeFromConfig` e a " "estrutura :c:type:`PyConfig`. Pode ser pré-inicializado com :c:func:" "`Py_PreInitialize` e a estrutura :c:type:`PyPreConfig`." #: ../../c-api/init_config.rst:15 msgid "There are two kinds of configuration:" msgstr "Existem dois tipos de configuração:" #: ../../c-api/init_config.rst:17 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 "" "A :ref:`Python Configuration ` pode ser usada para " "construir um Python personalizado que se comporta como um Python comum. Por " "exemplo, variáveis de ambiente e argumento de linha de comando são usados " "para configurar Python." #: ../../c-api/init_config.rst:22 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 "" "A :ref:`Configuração isolada ` pode ser usada para " "incorporar Python em uma aplicação. Isso isola Python de um sistema. Por " "exemplo, variáveis de ambiente são ignoradas, a variável local LC_CTYPE fica " "inalterada e nenhum manipulador de sinal é registrado." #: ../../c-api/init_config.rst:27 msgid "" "The :c:func:`Py_RunMain` function can be used to write a customized Python " "program." msgstr "" "A função :c:func:`Py_RunMain` pode ser usada para escrever um programa " "Python personalizado." #: ../../c-api/init_config.rst:30 msgid "" "See also :ref:`Initialization, Finalization, and Threads `." msgstr "" "Veja também :ref:`Inicialização, Finalização e Threads `." #: ../../c-api/init_config.rst:33 msgid ":pep:`587` \"Python Initialization Configuration\"." msgstr ":pep:`587` \"Configuração da inicialização do Python\"." #: ../../c-api/init_config.rst:37 msgid "Example" msgstr "Exemplo" #: ../../c-api/init_config.rst:39 msgid "Example of customized Python always running in isolated mode::" msgstr "" "Exemplo de Python personalizado sendo executado sempre em um modo isolado:" #: ../../c-api/init_config.rst:41 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:76 msgid "PyWideStringList" msgstr "PyWideStringList" #: ../../c-api/init_config.rst:80 msgid "List of ``wchar_t*`` strings." msgstr "Lista de strings ``wchar_t*``." #: ../../c-api/init_config.rst:82 msgid "" "If *length* is non-zero, *items* must be non-``NULL`` and all strings must " "be non-``NULL``." msgstr "" "Se *length* é diferente de zero, *items* deve ser diferente de ``NULL`` e " "todas as strings devem ser diferentes de ``NULL``." #: ../../c-api/init_config.rst:87 msgid "Methods:" msgstr "Métodos:" #: ../../c-api/init_config.rst:91 msgid "Append *item* to *list*." msgstr "Anexa *item* a *list*." #: ../../c-api/init_config.rst:93 ../../c-api/init_config.rst:104 msgid "Python must be preinitialized to call this function." msgstr "Python deve ser inicializado previamente antes de chamar essa função." #: ../../c-api/init_config.rst:97 msgid "Insert *item* into *list* at *index*." msgstr "Insere *item* na *list* na posição *index*." #: ../../c-api/init_config.rst:99 msgid "" "If *index* is greater than or equal to *list* length, append *item* to " "*list*." msgstr "" "Se *index* for maior ou igual ao comprimento da *list*, anexa o *item* a " "*list*." #: ../../c-api/init_config.rst:102 msgid "*index* must be greater than or equal to ``0``." msgstr "*index* deve ser maior que ou igual a ``0``." #: ../../c-api/init_config.rst:108 ../../c-api/init_config.rst:128 #: ../../c-api/init_config.rst:235 ../../c-api/init_config.rst:554 msgid "Structure fields:" msgstr "Campos de estrutura:" #: ../../c-api/init_config.rst:112 msgid "List length." msgstr "Comprimento da lista." #: ../../c-api/init_config.rst:116 msgid "List items." msgstr "Itens da lista." #: ../../c-api/init_config.rst:119 msgid "PyStatus" msgstr "PyStatus" #: ../../c-api/init_config.rst:123 msgid "" "Structure to store an initialization function status: success, error or exit." msgstr "" "Estrutura para armazenar o status de uma função de inicialização: sucesso, " "erro ou saída." #: ../../c-api/init_config.rst:126 msgid "For an error, it can store the C function name which created the error." msgstr "Para um erro, ela pode armazenar o nome da função C que criou o erro." #: ../../c-api/init_config.rst:132 msgid "Exit code. Argument passed to ``exit()``." msgstr "Código de saída. Argumento passado para ``exit()``." #: ../../c-api/init_config.rst:136 msgid "Error message." msgstr "Mensagem de erro." #: ../../c-api/init_config.rst:140 msgid "Name of the function which created an error, can be ``NULL``." msgstr "Nome da função que criou um erro. Pode ser ``NULL``." #: ../../c-api/init_config.rst:144 msgid "Functions to create a status:" msgstr "Funções para criar um status:" #: ../../c-api/init_config.rst:148 msgid "Success." msgstr "Sucesso." #: ../../c-api/init_config.rst:152 msgid "Initialization error with a message." msgstr "Erro de inicialização com uma mensagem." #: ../../c-api/init_config.rst:154 msgid "*err_msg* must not be ``NULL``." msgstr "*err_msg* não deve ser ``NULL``." #: ../../c-api/init_config.rst:158 msgid "Memory allocation failure (out of memory)." msgstr "Falha de alocação de memória (sem memória)." #: ../../c-api/init_config.rst:162 msgid "Exit Python with the specified exit code." msgstr "Sai do Python com o código de saída especificado." #: ../../c-api/init_config.rst:164 msgid "Functions to handle a status:" msgstr "Funções para manipular um status:" #: ../../c-api/init_config.rst:168 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 "" "O status é um erro ou uma saída? Se verdadeiro, a exceção deve ser tratada; " "chamando :c:func:`Py_ExitStatusException`, por exemplo." #: ../../c-api/init_config.rst:173 msgid "Is the result an error?" msgstr "O resultado é um erro?" #: ../../c-api/init_config.rst:177 msgid "Is the result an exit?" msgstr "O resultado é uma saída?" #: ../../c-api/init_config.rst:181 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 "" "Chama ``exit(exitcode)`` se *status* for uma saída. Exibe a mensagem de erro " "e sai com um código de saída diferente de zero se *status* for um erro. Deve " "ser chamado apenas se ``PyStatus_Exception(status)`` for diferente de zero." #: ../../c-api/init_config.rst:186 msgid "" "Internally, Python uses macros which set ``PyStatus.func``, whereas " "functions to create a status set ``func`` to ``NULL``." msgstr "" "Internamente, Python usa macros que definem ``PyStatus.func``, enquanto " "funções para criar um status definem ``func`` para ``NULL``." #: ../../c-api/init_config.rst:189 msgid "Example::" msgstr "Exemplo::" #: ../../c-api/init_config.rst:191 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:213 msgid "PyPreConfig" msgstr "PyPreConfig" #: ../../c-api/init_config.rst:217 msgid "Structure used to preinitialize Python." msgstr "Estrutura usada para pré-inicializar o Python." #: ../../c-api/init_config.rst:221 msgid "Function to initialize a preconfiguration:" msgstr "A função para inicializar uma pré-configuração:" #: ../../c-api/init_config.rst:225 msgid "" "Initialize the preconfiguration with :ref:`Python Configuration `." msgstr "" "Inicializa a pré-configuração com :ref:`Configuração do Python `." #: ../../c-api/init_config.rst:230 msgid "" "Initialize the preconfiguration with :ref:`Isolated Configuration `." msgstr "" "Inicializa a pré-configuração com :ref:`Configuração isolada `." #: ../../c-api/init_config.rst:239 msgid "Name of the Python memory allocators:" msgstr "Nome de alocadores de memória em Python:" #: ../../c-api/init_config.rst:241 msgid "" "``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use " "defaults)." msgstr "" "``PYMEM_ALLOCATOR_NOT_SET`` (``0``): não altera os alocadores de memória " "(usa o padrão)." #: ../../c-api/init_config.rst:243 msgid "" "``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`default memory allocators " "`." msgstr "" "``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`alocadores de memória padrão " "`." #: ../../c-api/init_config.rst:245 msgid "" "``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." msgstr "" "``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`alocadores de memória padrão " "` com :ref:`ganchos de depuração `." #: ../../c-api/init_config.rst:248 msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): use ``malloc()`` of the C library." msgstr "``PYMEM_ALLOCATOR_MALLOC`` (``3``): usa ``malloc()`` da biblioteca C." #: ../../c-api/init_config.rst:249 msgid "" "``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :" "ref:`debug hooks `." msgstr "" "``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): força uso de ``malloc()`` com :ref:" "`ganchos de depuração `." #: ../../c-api/init_config.rst:251 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator " "`." msgstr "" "``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`alocador de memória do Python " "pymalloc `." #: ../../c-api/init_config.rst:253 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " "allocator ` with :ref:`debug hooks `." msgstr "" "``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`alocador de memória deo " "Python pymalloc ` com :ref:`ganchos de depuração `." #: ../../c-api/init_config.rst:256 msgid "" "``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): use ``mimalloc``, a fast malloc " "replacement." msgstr "" "``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): usa ``mimalloc``, um substituto rápido " "do malloc." #: ../../c-api/init_config.rst:258 msgid "" "``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): use ``mimalloc``, a fast malloc " "replacement with :ref:`debug hooks `." msgstr "" "``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): use ``mimalloc``, um substituto " "rápido do malloc com :ref:`ganchos de depuração `." #: ../../c-api/init_config.rst:262 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not " "supported if Python is :option:`configured using --without-pymalloc <--" "without-pymalloc>`." msgstr "" "``PYMEM_ALLOCATOR_PYMALLOC`` e ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` não são " "suportados se o Python estiver :option:`configurado usando --without-" "pymalloc <--without-pymalloc>`." #: ../../c-api/init_config.rst:266 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 "" "``PYMEM_ALLOCATOR_MIMALLOC`` e ``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` não são " "suportados se o Python estiver :option:`configurado usando --without-" "mimalloc <--without-mimalloc>` ou se suporte atômico subjacente não estiver " "disponível." #: ../../c-api/init_config.rst:271 msgid "See :ref:`Memory Management `." msgstr "Veja :ref:`Gerenciamento de memória `." #: ../../c-api/init_config.rst:273 msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "Padrão: ``PYMEM_ALLOCATOR_NOT_SET``." #: ../../c-api/init_config.rst:277 msgid "Set the LC_CTYPE locale to the user preferred locale." msgstr "Define a localidade LC_CTYPE para a localidade preferida do usuário." #: ../../c-api/init_config.rst:279 msgid "" "If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:" "member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" "Se igual a ``0``, define os membros :c:member:`~PyPreConfig.coerce_c_locale` " "e :c:member:`~PyPreConfig.coerce_c_locale_warn` para ``0``." #: ../../c-api/init_config.rst:282 ../../c-api/init_config.rst:293 msgid "See the :term:`locale encoding`." msgstr "Veja a :term:`codificação da localidade`." #: ../../c-api/init_config.rst:284 ../../c-api/init_config.rst:339 #: ../../c-api/init_config.rst:710 msgid "Default: ``1`` in Python config, ``0`` in isolated config." msgstr "" "Padrão: ``1`` na configuração do Python, ``0`` na configuração isolada." #: ../../c-api/init_config.rst:288 msgid "If equals to ``2``, coerce the C locale." msgstr "Se igual a ``2``, força a localidade para C." #: ../../c-api/init_config.rst:290 msgid "" "If equals to ``1``, read the LC_CTYPE locale to decide if it should be " "coerced." msgstr "" "Se for igual a ``1``, lê a localidade LC_CTYPE para decidir se deve ser " "forçado." #: ../../c-api/init_config.rst:295 ../../c-api/init_config.rst:301 msgid "Default: ``-1`` in Python config, ``0`` in isolated config." msgstr "" "Padrão: ``-1`` na configuração do Python, ``0`` na configuração isolada." #: ../../c-api/init_config.rst:299 msgid "If non-zero, emit a warning if the C locale is coerced." msgstr "Se diferente de zero, emite um aviso se a localidade C for forçada." #: ../../c-api/init_config.rst:305 msgid "" ":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." msgstr "" ":ref:`Modo de desenvolvimento do Python `: veja :c:member:`PyConfig." "dev_mode`." #: ../../c-api/init_config.rst:308 ../../c-api/init_config.rst:719 #: ../../c-api/init_config.rst:765 ../../c-api/init_config.rst:1244 msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "Padrão: ``-1`` no modo do Python, ``0`` no modo isolado." #: ../../c-api/init_config.rst:312 msgid "Isolated mode: see :c:member:`PyConfig.isolated`." msgstr "Modo isolado: veja :c:member:`PyConfig.isolated`." #: ../../c-api/init_config.rst:314 ../../c-api/init_config.rst:921 msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." msgstr "Padrão: ``0`` no modo do Python, ``1`` no modo isolado." #: ../../c-api/init_config.rst:318 msgid "If non-zero:" msgstr "Se não zero:" #: ../../c-api/init_config.rst:320 msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," msgstr "Define :c:member:`PyPreConfig.utf8_mode` para ``0``," #: ../../c-api/init_config.rst:321 msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," msgstr "Define :c:member:`PyConfig.filesystem_encoding` para ``\"mbcs\"``," #: ../../c-api/init_config.rst:322 msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." msgstr "Define :c:member:`PyConfig.filesystem_errors` para ``\"replace\"``." #: ../../c-api/init_config.rst:324 msgid "" "Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable value." msgstr "" #: ../../c-api/init_config.rst:327 ../../c-api/init_config.rst:935 msgid "" "Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " "Windows specific code." msgstr "" "Disponível apenas no Windows. A macro ``#ifdef MS_WINDOWS`` pode ser usada " "para código específico do Windows." #: ../../c-api/init_config.rst:330 ../../c-api/init_config.rst:658 #: ../../c-api/init_config.rst:665 ../../c-api/init_config.rst:732 #: ../../c-api/init_config.rst:843 ../../c-api/init_config.rst:857 #: ../../c-api/init_config.rst:871 ../../c-api/init_config.rst:938 #: ../../c-api/init_config.rst:952 ../../c-api/init_config.rst:1012 #: ../../c-api/init_config.rst:1064 ../../c-api/init_config.rst:1126 #: ../../c-api/init_config.rst:1180 ../../c-api/init_config.rst:1209 #: ../../c-api/init_config.rst:1298 msgid "Default: ``0``." msgstr "Padrão: ``0``." #: ../../c-api/init_config.rst:334 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 "" "Se diferente de zero, :c:func:`Py_PreInitializeFromArgs` e :c:func:" "`Py_PreInitializeFromBytesArgs` analisam seu argumento ``argv`` da mesma " "forma que o Python regular analisa argumentos de linha de comando: veja :ref:" "`Argumentos de linha de comando `." #: ../../c-api/init_config.rst:343 msgid "" "Use :ref:`environment variables `? See :c:member:`PyConfig." "use_environment`." msgstr "" "Usar :ref:`variáveis de ambiente `? Veja :c:member:" "`PyConfig.use_environment`." #: ../../c-api/init_config.rst:346 ../../c-api/init_config.rst:1272 msgid "Default: ``1`` in Python config and ``0`` in isolated config." msgstr "" "Padrão: ``1`` na configuração do Python e ``0`` na configuração isolada." #: ../../c-api/init_config.rst:350 msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." msgstr "Se não zero, habilita o :ref:`modo UTF-8 do Python `." #: ../../c-api/init_config.rst:352 msgid "" "Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and " "the :envvar:`PYTHONUTF8` environment variable." msgstr "" "Define para ``0`` ou ``1`` pela opção de linha de comando :option:`-X utf8 <-" "X>` e a variável de ambiente :envvar:`PYTHONUTF8`." #: ../../c-api/init_config.rst:355 msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." msgstr "" "Também define como ``1`` se a localidade ``LC_CTYPE`` for ``C`` ou ``POSIX``." #: ../../c-api/init_config.rst:357 msgid "Default: ``-1`` in Python config and ``0`` in isolated config." msgstr "" "Padrão: ``-1`` na configuração do Python e ``0`` na configuração isolada." #: ../../c-api/init_config.rst:363 msgid "Preinitialize Python with PyPreConfig" msgstr "Pré-inicializar Python com PyPreConfig" #: ../../c-api/init_config.rst:365 msgid "The preinitialization of Python:" msgstr "A pré-inicialização do Python:" #: ../../c-api/init_config.rst:367 msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" msgstr "" "Define os alocadores de memória Python (:c:member:`PyPreConfig.allocator`)" #: ../../c-api/init_config.rst:368 msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" msgstr "Configura a localidade LC_CTYPE (:term:`codificação da localidade`)" #: ../../c-api/init_config.rst:369 msgid "" "Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." "utf8_mode`)" msgstr "" "Define o :ref:`Modo UTF-8 do Python ` (:c:member:`PyPreConfig." "utf8_mode`)" #: ../../c-api/init_config.rst:372 msgid "" "The current preconfiguration (``PyPreConfig`` type) is stored in " "``_PyRuntime.preconfig``." msgstr "" "A pré-configuração atual (tipo ``PyPreConfig``) é armazenada em ``_PyRuntime." "preconfig``." #: ../../c-api/init_config.rst:375 msgid "Functions to preinitialize Python:" msgstr "Funções para pré-inicializar Python:" #: ../../c-api/init_config.rst:379 ../../c-api/init_config.rst:385 #: ../../c-api/init_config.rst:394 msgid "Preinitialize Python from *preconfig* preconfiguration." msgstr "Pré-inicializa o Python a partir da pré-configuração *preconfig*." #: ../../c-api/init_config.rst:381 ../../c-api/init_config.rst:390 #: ../../c-api/init_config.rst:399 msgid "*preconfig* must not be ``NULL``." msgstr "*preconfig* não pode ser ``NULL``.." #: ../../c-api/init_config.rst:387 msgid "" "Parse *argv* command line arguments (bytes strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" "Analisa argumentos de linha de comando *argv* (strings de bytes) se :c:" "member:`~PyPreConfig.parse_argv` de *preconfig* for diferente de zero." #: ../../c-api/init_config.rst:396 msgid "" "Parse *argv* command line arguments (wide strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" "Analisa argumentos de linha de comando *argv* (strings largas) se :c:member:" "`~PyPreConfig.parse_argv` de *preconfig* for diferente de zero." #: ../../c-api/init_config.rst:401 ../../c-api/init_config.rst:1359 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" "O chamador é responsável por manipular exceções (erro ou saída) usando :c:" "func:`PyStatus_Exception` e :c:func:`Py_ExitStatusException`." #: ../../c-api/init_config.rst:404 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 "" "Para :ref:`configuração do Python ` (:c:func:" "`PyPreConfig_InitPythonConfig`), se o Python for inicializado com argumentos " "de linha de comando, os argumentos de linha de comando também devem ser " "passados para pré-inicializar o Python, pois eles têm um efeito na pré-" "configuração como codificações. Por exemplo, a opção de linha de comando :" "option:`-X utf8 <-X>` habilita o :ref:`Modo UTF-8 do Python `." #: ../../c-api/init_config.rst:411 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 "" "``PyMem_SetAllocator()`` pode ser chamado depois de :c:func:" "`Py_PreInitialize` e antes de :c:func:`Py_InitializeFromConfig` para " "instalar um alocador de memória personalizado. Ele pode ser chamado antes " "de :c:func:`Py_PreInitialize` se :c:member:`PyPreConfig.allocator` estiver " "definido como ``PYMEM_ALLOCATOR_NOT_SET``." #: ../../c-api/init_config.rst:416 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 "" "Funções de alocação de memória do Python como :c:func:`PyMem_RawMalloc` não " "devem ser usadas antes da pré-inicialização do Python, enquanto chamar " "diretamente ``malloc()`` e ``free()`` é sempre seguro. :c:func:" "`Py_DecodeLocale` não deve ser chamado antes da pré-inicialização do Python." #: ../../c-api/init_config.rst:421 msgid "" "Example using the preinitialization to enable the :ref:`Python UTF-8 Mode " "`::" msgstr "" "Exemplo usando a pré-inicialização para habilitar o :ref:`modo UTF-8 do " "Python `." #: ../../c-api/init_config.rst:424 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:443 msgid "PyConfig" msgstr "PyConfig" #: ../../c-api/init_config.rst:447 msgid "Structure containing most parameters to configure Python." msgstr "Estrutura contendo a maioria dos parâmetros para configurar o Python." #: ../../c-api/init_config.rst:449 msgid "" "When done, the :c:func:`PyConfig_Clear` function must be used to release the " "configuration memory." msgstr "" "Ao terminar, a função :c:func:`PyConfig_Clear` deve ser usada para liberar a " "memória de configuração." #: ../../c-api/init_config.rst:454 msgid "Structure methods:" msgstr "" #: ../../c-api/init_config.rst:458 msgid "" "Initialize configuration with the :ref:`Python Configuration `." msgstr "" #: ../../c-api/init_config.rst:463 msgid "" "Initialize configuration with the :ref:`Isolated Configuration `." msgstr "" #: ../../c-api/init_config.rst:468 msgid "Copy the wide character string *str* into ``*config_str``." msgstr "" #: ../../c-api/init_config.rst:470 ../../c-api/init_config.rst:477 #: ../../c-api/init_config.rst:484 ../../c-api/init_config.rst:492 #: ../../c-api/init_config.rst:498 ../../c-api/init_config.rst:515 msgid ":ref:`Preinitialize Python ` if needed." msgstr "" #: ../../c-api/init_config.rst:474 msgid "" "Decode *str* using :c:func:`Py_DecodeLocale` and set the result into " "``*config_str``." msgstr "" #: ../../c-api/init_config.rst:481 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:488 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:496 msgid "Set the list of wide strings *list* to *length* and *items*." msgstr "" #: ../../c-api/init_config.rst:502 msgid "Read all Python configuration." msgstr "Lê toda a configuração do Python." #: ../../c-api/init_config.rst:504 msgid "Fields which are already initialized are left unchanged." msgstr "Campos que já estão inicializados permanecem inalterados." #: ../../c-api/init_config.rst:506 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:509 ../../c-api/init_config.rst:1041 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:517 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:523 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:531 msgid "Release configuration memory." msgstr "Libera memória de configuração." #: ../../c-api/init_config.rst:533 msgid "" "Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. " "In that case, the Python preinitialization configuration (:c:type:" "`PyPreConfig`) is 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:539 msgid ":c:member:`PyConfig.dev_mode`" msgstr ":c:member:`PyConfig.dev_mode`" #: ../../c-api/init_config.rst:540 msgid ":c:member:`PyConfig.isolated`" msgstr ":c:member:`PyConfig.isolated`" #: ../../c-api/init_config.rst:541 msgid ":c:member:`PyConfig.parse_argv`" msgstr ":c:member:`PyConfig.parse_argv`" #: ../../c-api/init_config.rst:542 msgid ":c:member:`PyConfig.use_environment`" msgstr ":c:member:`PyConfig.use_environment`" #: ../../c-api/init_config.rst:544 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:549 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:562 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:570 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:575 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:578 ../../c-api/init_config.rst:605 #: ../../c-api/init_config.rst:619 ../../c-api/init_config.rst:629 #: ../../c-api/init_config.rst:739 ../../c-api/init_config.rst:750 #: ../../c-api/init_config.rst:832 ../../c-api/init_config.rst:982 #: ../../c-api/init_config.rst:1083 ../../c-api/init_config.rst:1102 #: ../../c-api/init_config.rst:1117 ../../c-api/init_config.rst:1134 #: ../../c-api/init_config.rst:1147 ../../c-api/init_config.rst:1155 #: ../../c-api/init_config.rst:1169 msgid "Default: ``NULL``." msgstr "Padrão: ``NULL``." #: ../../c-api/init_config.rst:580 msgid "See also the :c:member:`~PyConfig.orig_argv` member." msgstr "" #: ../../c-api/init_config.rst:584 msgid "" "If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :" "data:`sys.path` at startup:" msgstr "" #: ../../c-api/init_config.rst:587 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:589 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:591 msgid "" "Otherwise (``python -c code`` and ``python``), prepend an empty string, " "which means the current working directory." msgstr "" #: ../../c-api/init_config.rst:594 msgid "" "Set to ``1`` by the :option:`-P` command line option and the :envvar:" "`PYTHONSAFEPATH` environment variable." msgstr "" #: ../../c-api/init_config.rst:597 msgid "Default: ``0`` in Python config, ``1`` in isolated config." msgstr "" #: ../../c-api/init_config.rst:603 msgid ":data:`sys.base_exec_prefix`." msgstr ":data:`sys.base_exec_prefix`." #: ../../c-api/init_config.rst:607 ../../c-api/init_config.rst:621 #: ../../c-api/init_config.rst:631 ../../c-api/init_config.rst:741 #: ../../c-api/init_config.rst:752 ../../c-api/init_config.rst:999 #: ../../c-api/init_config.rst:1085 msgid "Part of the :ref:`Python Path Configuration ` output." msgstr "" #: ../../c-api/init_config.rst:609 msgid "See also :c:member:`PyConfig.exec_prefix`." msgstr "Veja também :c:member:`PyConfig.exec_prefix`." #: ../../c-api/init_config.rst:613 msgid "Python base executable: :data:`sys._base_executable`." msgstr "" #: ../../c-api/init_config.rst:615 msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." msgstr "" #: ../../c-api/init_config.rst:617 msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." msgstr "" #: ../../c-api/init_config.rst:623 msgid "See also :c:member:`PyConfig.executable`." msgstr "" #: ../../c-api/init_config.rst:627 msgid ":data:`sys.base_prefix`." msgstr ":data:`sys.base_prefix`." #: ../../c-api/init_config.rst:633 msgid "See also :c:member:`PyConfig.prefix`." msgstr "" #: ../../c-api/init_config.rst:637 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:640 msgid "" "Set to ``0`` by the :option:`-u` command line option and the :envvar:" "`PYTHONUNBUFFERED` environment variable." msgstr "" #: ../../c-api/init_config.rst:643 msgid "stdin is always opened in buffered mode." msgstr "" #: ../../c-api/init_config.rst:645 ../../c-api/init_config.rst:678 #: ../../c-api/init_config.rst:1197 ../../c-api/init_config.rst:1330 msgid "Default: ``1``." msgstr "Padrão: ``1``." #: ../../c-api/init_config.rst:649 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:653 msgid "" "If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these " "cases." msgstr "" #: ../../c-api/init_config.rst:656 msgid "Incremented by the :option:`-b` command line option." msgstr "" #: ../../c-api/init_config.rst:662 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:671 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:675 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:684 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:687 msgid "Valid values:" msgstr "Valores válidos:" #: ../../c-api/init_config.rst:689 msgid "" "``L\"always\"``: Hash the source file for invalidation regardless of value " "of the 'check_source' flag." msgstr "" #: ../../c-api/init_config.rst:691 msgid "``L\"never\"``: Assume that hash-based pycs always are valid." msgstr "" #: ../../c-api/init_config.rst:692 msgid "" "``L\"default\"``: The 'check_source' flag in hash-based pycs determines " "invalidation." msgstr "" #: ../../c-api/init_config.rst:695 msgid "Default: ``L\"default\"``." msgstr "" #: ../../c-api/init_config.rst:697 msgid "See also :pep:`552` \"Deterministic pycs\"." msgstr "" #: ../../c-api/init_config.rst:701 msgid "If non-zero, configure C standard streams:" msgstr "" #: ../../c-api/init_config.rst:703 msgid "" "On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." msgstr "" #: ../../c-api/init_config.rst:705 msgid "" "If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of " "stdin, stdout and stderr streams." msgstr "" #: ../../c-api/init_config.rst:707 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:714 msgid "If non-zero, enable the :ref:`Python Development Mode `." msgstr "" #: ../../c-api/init_config.rst:716 msgid "" "Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:" "`PYTHONDEVMODE` environment variable." msgstr "" #: ../../c-api/init_config.rst:723 msgid "Dump Python references?" msgstr "" #: ../../c-api/init_config.rst:725 msgid "If non-zero, dump all objects which are still alive at exit." msgstr "" #: ../../c-api/init_config.rst:727 msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable." msgstr "" #: ../../c-api/init_config.rst:729 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:736 msgid "" "The site-specific directory prefix where the platform-dependent Python files " "are installed: :data:`sys.exec_prefix`." msgstr "" #: ../../c-api/init_config.rst:743 msgid "See also :c:member:`PyConfig.base_exec_prefix`." msgstr "" #: ../../c-api/init_config.rst:747 msgid "" "The absolute path of the executable binary for the Python interpreter: :data:" "`sys.executable`." msgstr "" #: ../../c-api/init_config.rst:754 msgid "See also :c:member:`PyConfig.base_executable`." msgstr "" #: ../../c-api/init_config.rst:758 msgid "Enable faulthandler?" msgstr "" #: ../../c-api/init_config.rst:760 msgid "If non-zero, call :func:`faulthandler.enable` at startup." msgstr "" #: ../../c-api/init_config.rst:762 msgid "" "Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:" "`PYTHONFAULTHANDLER` environment variable." msgstr "" #: ../../c-api/init_config.rst:769 msgid "" ":term:`Filesystem encoding `: :func:" "`sys.getfilesystemencoding`." msgstr "" #: ../../c-api/init_config.rst:772 msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default." msgstr "" #: ../../c-api/init_config.rst:774 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:778 msgid "Default encoding on other platforms:" msgstr "" #: ../../c-api/init_config.rst:780 msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" #: ../../c-api/init_config.rst:781 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:784 msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." msgstr "" #: ../../c-api/init_config.rst:785 msgid "" "Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." msgstr "" #: ../../c-api/init_config.rst:788 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:791 msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." msgstr "" #: ../../c-api/init_config.rst:795 msgid "" ":term:`Filesystem error handler `: :" "func:`sys.getfilesystemencodeerrors`." msgstr "" #: ../../c-api/init_config.rst:798 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:802 msgid "On other platforms: use ``\"surrogateescape\"`` by default." msgstr "" #: ../../c-api/init_config.rst:804 msgid "Supported error handlers:" msgstr "" #: ../../c-api/init_config.rst:806 msgid "``\"strict\"``" msgstr "``\"strict\"``" #: ../../c-api/init_config.rst:807 msgid "``\"surrogateescape\"``" msgstr "``\"surrogateescape\"``" #: ../../c-api/init_config.rst:808 msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" msgstr "" #: ../../c-api/init_config.rst:810 msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." msgstr "" #: ../../c-api/init_config.rst:815 msgid "Randomized hash function seed." msgstr "" #: ../../c-api/init_config.rst:817 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:820 msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." msgstr "" #: ../../c-api/init_config.rst:822 msgid "" "Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" #: ../../c-api/init_config.rst:827 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:830 msgid "Set by the :envvar:`PYTHONHOME` environment variable." msgstr "" #: ../../c-api/init_config.rst:834 ../../c-api/init_config.rst:964 #: ../../c-api/init_config.rst:984 ../../c-api/init_config.rst:1073 #: ../../c-api/init_config.rst:1104 msgid "Part of the :ref:`Python Path Configuration ` input." msgstr "" #: ../../c-api/init_config.rst:838 msgid "If non-zero, profile import time." msgstr "" #: ../../c-api/init_config.rst:840 msgid "" "Set the ``1`` by the :option:`-X importtime <-X>` option and the :envvar:" "`PYTHONPROFILEIMPORTTIME` environment variable." msgstr "" #: ../../c-api/init_config.rst:847 msgid "Enter interactive mode after executing a script or a command." msgstr "" #: ../../c-api/init_config.rst:849 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:854 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:861 msgid "Install Python signal handlers?" msgstr "" #: ../../c-api/init_config.rst:863 ../../c-api/init_config.rst:1047 #: ../../c-api/init_config.rst:1071 ../../c-api/init_config.rst:1282 msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." msgstr "" #: ../../c-api/init_config.rst:867 msgid "If greater than ``0``, enable the interactive mode (REPL)." msgstr "" #: ../../c-api/init_config.rst:869 msgid "Incremented by the :option:`-i` command line option." msgstr "" #: ../../c-api/init_config.rst:875 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:883 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:886 msgid "" "Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." "default_max_str_digits`) in isolated mode." msgstr "" #: ../../c-api/init_config.rst:893 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:897 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:900 ../../c-api/init_config.rst:1259 msgid "Default: ``-1``." msgstr "" #: ../../c-api/init_config.rst:906 msgid "If greater than ``0``, enable isolated mode:" msgstr "" #: ../../c-api/init_config.rst:908 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:912 msgid "" "Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " "environment variables." msgstr "" #: ../../c-api/init_config.rst:914 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:916 msgid "" "Python REPL doesn't import :mod:`readline` nor enable default readline " "configuration on interactive prompts." msgstr "" #: ../../c-api/init_config.rst:919 msgid "Set to ``1`` by the :option:`-I` command line option." msgstr "" #: ../../c-api/init_config.rst:923 msgid "" "See also the :ref:`Isolated Configuration ` and :c:" "member:`PyPreConfig.isolated`." msgstr "" #: ../../c-api/init_config.rst:928 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:932 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" "Definida como ``1`` se a variável de ambiente :envvar:" "`PYTHONLEGACYWINDOWSSTDIO` estiver definida como uma string não vazia." #: ../../c-api/init_config.rst:940 msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." msgstr "" #: ../../c-api/init_config.rst:944 msgid "" "If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " "` at exit." msgstr "" #: ../../c-api/init_config.rst:947 msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." msgstr "" #: ../../c-api/init_config.rst:949 msgid "" "The option is ignored if Python is :option:`configured using the --without-" "pymalloc option <--without-pymalloc>`." msgstr "" #: ../../c-api/init_config.rst:956 msgid "Platform library directory name: :data:`sys.platlibdir`." msgstr "" #: ../../c-api/init_config.rst:958 msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." msgstr "" #: ../../c-api/init_config.rst:960 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:968 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:977 msgid "" "Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" "data:`os.pathsep`)." msgstr "" #: ../../c-api/init_config.rst:980 msgid "Set by the :envvar:`PYTHONPATH` environment variable." msgstr "" #: ../../c-api/init_config.rst:989 msgid "Module search paths: :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:991 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:996 msgid "" "Default: empty list (``module_search_paths``) and ``0`` " "(``module_search_paths_set``)." msgstr "" #: ../../c-api/init_config.rst:1003 msgid "Compilation optimization level:" msgstr "" #: ../../c-api/init_config.rst:1005 msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." msgstr "" #: ../../c-api/init_config.rst:1006 msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." msgstr "" #: ../../c-api/init_config.rst:1007 msgid "``2``: Level 1, strip docstrings." msgstr "" #: ../../c-api/init_config.rst:1009 msgid "" "Incremented by the :option:`-O` command line option. Set to the :envvar:" "`PYTHONOPTIMIZE` environment variable value." msgstr "" #: ../../c-api/init_config.rst:1016 msgid "" "The list of the original command line arguments passed to the Python " "executable: :data:`sys.orig_argv`." msgstr "" #: ../../c-api/init_config.rst:1019 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:1026 msgid "" "See also the :c:member:`~PyConfig.argv` member and the :c:func:" "`Py_GetArgcArgv` function." msgstr "" #: ../../c-api/init_config.rst:1029 ../../c-api/init_config.rst:1317 #: ../../c-api/init_config.rst:1336 msgid "Default: empty list." msgstr "Padrão: lista vazia." #: ../../c-api/init_config.rst:1035 msgid "Parse command line arguments?" msgstr "" #: ../../c-api/init_config.rst:1037 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:1049 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:1055 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:1058 msgid "" "Incremented by the :option:`-d` command line option. Set to the :envvar:" "`PYTHONDEBUG` environment variable value." msgstr "" #: ../../c-api/init_config.rst:1061 ../../c-api/init_config.rst:1166 msgid "" "Needs a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " "must be defined)." msgstr "" #: ../../c-api/init_config.rst:1068 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:1075 msgid "Now also applies on Windows." msgstr "" #: ../../c-api/init_config.rst:1080 msgid "" "The site-specific directory prefix where the platform independent Python " "files are installed: :data:`sys.prefix`." msgstr "" #: ../../c-api/init_config.rst:1087 msgid "See also :c:member:`PyConfig.base_prefix`." msgstr "" #: ../../c-api/init_config.rst:1091 msgid "" "Program name used to initialize :c:member:`~PyConfig.executable` and in " "early error messages during Python initialization." msgstr "" #: ../../c-api/init_config.rst:1094 msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." msgstr "" #: ../../c-api/init_config.rst:1095 msgid "" "If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" "`__PYVENV_LAUNCHER__` environment variable if set." msgstr "" #: ../../c-api/init_config.rst:1097 msgid "" "Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." msgstr "" #: ../../c-api/init_config.rst:1099 msgid "" "Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " "platforms." msgstr "" #: ../../c-api/init_config.rst:1108 msgid "" "Directory where cached ``.pyc`` files are written: :data:`sys." "pycache_prefix`." msgstr "" #: ../../c-api/init_config.rst:1111 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:1115 msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." msgstr "" #: ../../c-api/init_config.rst:1121 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:1124 msgid "Incremented by the :option:`-q` command line option." msgstr "" #: ../../c-api/init_config.rst:1130 msgid "Value of the :option:`-c` command line option." msgstr "" #: ../../c-api/init_config.rst:1132 ../../c-api/init_config.rst:1153 msgid "Used by :c:func:`Py_RunMain`." msgstr "" #: ../../c-api/init_config.rst:1138 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:1142 msgid "" "For example, it is set to ``script.py`` by the ``python3 script.py arg`` " "command line." msgstr "" #: ../../c-api/init_config.rst:1145 msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." msgstr "" #: ../../c-api/init_config.rst:1151 msgid "Value of the :option:`-m` command line option." msgstr "" #: ../../c-api/init_config.rst:1159 msgid "" "``package.module`` path to module that should be imported before ``site.py`` " "is run." msgstr "" #: ../../c-api/init_config.rst:1162 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:1173 msgid "" "Show total reference count at exit (excluding :term:`immortal` objects)?" msgstr "" #: ../../c-api/init_config.rst:1175 msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." msgstr "" #: ../../c-api/init_config.rst:1177 msgid "" "Needs a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " "macro must be defined)." msgstr "" #: ../../c-api/init_config.rst:1184 msgid "Import the :mod:`site` module at startup?" msgstr "" #: ../../c-api/init_config.rst:1186 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:1189 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:1192 msgid "Set to ``0`` by the :option:`-S` command line option." msgstr "" #: ../../c-api/init_config.rst:1194 msgid "" ":data:`sys.flags.no_site ` is set to the inverted value of :c:" "member:`~PyConfig.site_import`." msgstr "" #: ../../c-api/init_config.rst:1201 msgid "" "If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " "source." msgstr "" #: ../../c-api/init_config.rst:1204 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:1207 msgid "Set to ``1`` by the :option:`-x` command line option." msgstr "" #: ../../c-api/init_config.rst:1214 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:1218 msgid "" "Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." msgstr "" #: ../../c-api/init_config.rst:1221 msgid "Default encoding:" msgstr "Codificação padrão:" #: ../../c-api/init_config.rst:1223 msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "" #: ../../c-api/init_config.rst:1224 msgid "Otherwise, use the :term:`locale encoding`." msgstr "" #: ../../c-api/init_config.rst:1226 msgid "Default error handler:" msgstr "Tratador de erros padrão:" #: ../../c-api/init_config.rst:1228 msgid "On Windows: use ``\"surrogateescape\"``." msgstr "" #: ../../c-api/init_config.rst:1229 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:1231 msgid "``\"strict\"`` otherwise." msgstr "" #: ../../c-api/init_config.rst:1233 msgid "See also :c:member:`PyConfig.legacy_windows_stdio`." msgstr "" #: ../../c-api/init_config.rst:1237 msgid "Enable tracemalloc?" msgstr "" #: ../../c-api/init_config.rst:1239 msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" #: ../../c-api/init_config.rst:1241 msgid "" "Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" "envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" #: ../../c-api/init_config.rst:1248 msgid "Enable compatibility mode with the perf profiler?" msgstr "" #: ../../c-api/init_config.rst:1250 msgid "" "If non-zero, initialize the perf trampoline. See :ref:`perf_profiling` for " "more information." msgstr "" #: ../../c-api/init_config.rst:1253 msgid "" "Set by :option:`-X perf <-X>` command-line option and by the :envvar:" "`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support with stack " "pointers and :option:`-X perf_jit <-X>` command-line option and by the :" "envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable for perf support with " "DWARF JIT information." msgstr "" #: ../../c-api/init_config.rst:1265 msgid "Use :ref:`environment variables `?" msgstr "" #: ../../c-api/init_config.rst:1267 msgid "" "If equals to zero, ignore the :ref:`environment variables `." msgstr "" #: ../../c-api/init_config.rst:1270 msgid "Set to ``0`` by the :option:`-E` environment variable." msgstr "" #: ../../c-api/init_config.rst:1276 msgid "If non-zero, add the user site directory to :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:1278 msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." msgstr "" #: ../../c-api/init_config.rst:1280 msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" #: ../../c-api/init_config.rst:1286 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:1290 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:1294 msgid "Incremented by the :option:`-v` command line option." msgstr "" #: ../../c-api/init_config.rst:1296 msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." msgstr "" #: ../../c-api/init_config.rst:1302 msgid "" "Options of the :mod:`warnings` module to build warnings filters, lowest to " "highest priority: :data:`sys.warnoptions`." msgstr "" #: ../../c-api/init_config.rst:1305 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:1310 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:1313 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:1321 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:1324 msgid "" "Set to ``0`` by the :option:`-B` command line option and the :envvar:" "`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" #: ../../c-api/init_config.rst:1327 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" "member:`~PyConfig.write_bytecode`." msgstr "" #: ../../c-api/init_config.rst:1334 msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" #: ../../c-api/init_config.rst:1338 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:1343 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:1348 msgid "The ``show_alloc_count`` field has been removed." msgstr "" #: ../../c-api/init_config.rst:1354 msgid "Initialization with PyConfig" msgstr "" #: ../../c-api/init_config.rst:1356 msgid "" "Initializing the interpreter from a populated configuration struct is " "handled by calling :c:func:`Py_InitializeFromConfig`." msgstr "" #: ../../c-api/init_config.rst:1362 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:1369 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" #: ../../c-api/init_config.rst:1372 msgid "Example setting the program name::" msgstr "" #: ../../c-api/init_config.rst:1374 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:1400 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:1407 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:1463 msgid "Isolated Configuration" msgstr "" #: ../../c-api/init_config.rst:1465 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:1470 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:1475 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:1483 msgid "Python Configuration" msgstr "Configuração do Python" #: ../../c-api/init_config.rst:1485 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:1489 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" #: ../../c-api/init_config.rst:1492 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:1501 msgid "Python Path Configuration" msgstr "" #: ../../c-api/init_config.rst:1503 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" #: ../../c-api/init_config.rst:1505 msgid "Path configuration inputs:" msgstr "" #: ../../c-api/init_config.rst:1507 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" #: ../../c-api/init_config.rst:1508 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" #: ../../c-api/init_config.rst:1509 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" #: ../../c-api/init_config.rst:1510 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" #: ../../c-api/init_config.rst:1511 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" #: ../../c-api/init_config.rst:1512 msgid "current working directory: to get absolute paths" msgstr "" #: ../../c-api/init_config.rst:1513 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" #: ../../c-api/init_config.rst:1515 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "" #: ../../c-api/init_config.rst:1516 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:1520 msgid "Path configuration output fields:" msgstr "" #: ../../c-api/init_config.rst:1522 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" #: ../../c-api/init_config.rst:1523 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" #: ../../c-api/init_config.rst:1524 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" #: ../../c-api/init_config.rst:1525 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" #: ../../c-api/init_config.rst:1526 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" #: ../../c-api/init_config.rst:1527 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" #: ../../c-api/init_config.rst:1529 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" #: ../../c-api/init_config.rst:1531 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:1537 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:1544 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:1547 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:1551 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" #: ../../c-api/init_config.rst:1553 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:1556 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" #: ../../c-api/init_config.rst:1558 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:1560 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:1562 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" #: ../../c-api/init_config.rst:1564 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:1570 msgid "The following configuration files are used by the path configuration:" msgstr "" #: ../../c-api/init_config.rst:1572 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" #: ../../c-api/init_config.rst:1573 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" #: ../../c-api/init_config.rst:1574 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" #: ../../c-api/init_config.rst:1576 msgid "If a ``._pth`` file is present:" msgstr "" #: ../../c-api/init_config.rst:1578 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "" #: ../../c-api/init_config.rst:1579 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "" #: ../../c-api/init_config.rst:1580 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "" #: ../../c-api/init_config.rst:1581 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "" #: ../../c-api/init_config.rst:1583 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`." msgstr "" #: ../../c-api/init_config.rst:1588 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" #: ../../c-api/init_config.rst:1592 msgid "Get the original command line arguments, before Python modified them." msgstr "" #: ../../c-api/init_config.rst:1594 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "" #: ../../c-api/init_config.rst:1598 msgid "Multi-Phase Initialization Private Provisional API" msgstr "" #: ../../c-api/init_config.rst:1600 msgid "" "This section is a private provisional API introducing multi-phase " "initialization, the core feature of :pep:`432`:" msgstr "" #: ../../c-api/init_config.rst:1603 msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" #: ../../c-api/init_config.rst:1605 msgid "Builtin types;" msgstr "" #: ../../c-api/init_config.rst:1606 msgid "Builtin exceptions;" msgstr "" #: ../../c-api/init_config.rst:1607 msgid "Builtin and frozen modules;" msgstr "" #: ../../c-api/init_config.rst:1608 msgid "" "The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " "doesn't exist yet)." msgstr "" #: ../../c-api/init_config.rst:1611 msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" #: ../../c-api/init_config.rst:1613 msgid "Install and configure :mod:`importlib`;" msgstr "" #: ../../c-api/init_config.rst:1614 msgid "Apply the :ref:`Path Configuration `;" msgstr "" #: ../../c-api/init_config.rst:1615 msgid "Install signal handlers;" msgstr "" #: ../../c-api/init_config.rst:1616 msgid "" "Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" "data:`sys.path`);" msgstr "" #: ../../c-api/init_config.rst:1618 msgid "" "Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" #: ../../c-api/init_config.rst:1619 msgid "Import the :mod:`site` module;" msgstr "" #: ../../c-api/init_config.rst:1620 msgid "etc." msgstr "etc." #: ../../c-api/init_config.rst:1622 msgid "Private provisional API:" msgstr "" #: ../../c-api/init_config.rst:1624 msgid "" ":c:member:`PyConfig._init_main`: if set to ``0``, :c:func:" "`Py_InitializeFromConfig` stops at the \"Core\" initialization phase." msgstr "" #: ../../c-api/init_config.rst:1629 msgid "" "Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" #: ../../c-api/init_config.rst:1631 msgid "" "No module is imported during the \"Core\" phase and the ``importlib`` module " "is not configured: the :ref:`Path Configuration ` is only " "applied during the \"Main\" phase. It may allow to customize Python in " "Python to override or tune the :ref:`Path Configuration `, " "maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" #: ../../c-api/init_config.rst:1637 msgid "" "It may become possible to calculate the :ref:`Path Configuration ` in Python, after the Core phase and before the Main phase, which is " "one of the :pep:`432` motivation." msgstr "" #: ../../c-api/init_config.rst:1641 msgid "" "The \"Core\" phase is not properly defined: what should be and what should " "not be available at this phase is not specified yet. The API is marked as " "private and provisional: the API can be modified or even be removed anytime " "until a proper public API is designed." msgstr "" #: ../../c-api/init_config.rst:1646 msgid "" "Example running Python code between \"Core\" and \"Main\" initialization " "phases::" msgstr "" #: ../../c-api/init_config.rst:1649 msgid "" "void init_python(void)\n" "{\n" " PyStatus status;\n" "\n" " PyConfig config;\n" " PyConfig_InitPythonConfig(&config);\n" " config._init_main = 0;\n" "\n" " /* ... customize 'config' configuration ... */\n" "\n" " status = Py_InitializeFromConfig(&config);\n" " PyConfig_Clear(&config);\n" " if (PyStatus_Exception(status)) {\n" " Py_ExitStatusException(status);\n" " }\n" "\n" " /* Use sys.stderr because sys.stdout is only created\n" " by _Py_InitializeMain() */\n" " int res = PyRun_SimpleString(\n" " \"import sys; \"\n" " \"print('Run Python code before _Py_InitializeMain', \"\n" " \"file=sys.stderr)\");\n" " if (res < 0) {\n" " exit(1);\n" " }\n" "\n" " /* ... put more configuration code here ... */\n" "\n" " status = _Py_InitializeMain();\n" " if (PyStatus_Exception(status)) {\n" " Py_ExitStatusException(status);\n" " }\n" "}" msgstr "" #: ../../c-api/init_config.rst:558 msgid "main()" msgstr "" #: ../../c-api/init_config.rst:558 msgid "argv (in module sys)" msgstr ""