@@ -12,7 +12,7 @@ msgid ""
1212msgstr ""
1313"Project-Id-Version : Python 3.14\n "
1414"Report-Msgid-Bugs-To : \n "
15- "POT-Creation-Date : 2025-11-27 14:15 +0000\n "
15+ "POT-Creation-Date : 2025-11-29 14:13 +0000\n "
1616"PO-Revision-Date : 2025-09-16 00:00+0000\n "
1717"Last-Translator : Rafael Fontenelle <rffontenelle@gmail.com>, 2025\n "
1818"Language-Team : Portuguese (Brazil) (https://app.transifex.com/python-doc/ "
@@ -1366,10 +1366,15 @@ msgid ""
13661366"not modify its value. The value is available to Python code as :data:`sys."
13671367"version`."
13681368msgstr ""
1369+ "A primeira palavra (até o primeiro espaço em branco) representa a versão "
1370+ "atual do Python; os primeiros caracteres indicam a versão principal e a "
1371+ "versão secundária, separados por um ponto. A string retornada aponta para um "
1372+ "armazenamento estático; o chamador não deve modificar seu valor. O valor "
1373+ "fica disponível para o código Python como :data:`sys.version`."
13691374
13701375#: ../../c-api/init.rst:752
13711376msgid "See also the :c:var:`Py_Version` constant."
1372- msgstr ""
1377+ msgstr "Veja também a constante :c:var:`Py_Version`. "
13731378
13741379#: ../../c-api/init.rst:759
13751380msgid ""
@@ -1381,6 +1386,13 @@ msgid ""
13811386"into static storage; the caller should not modify its value. The value is "
13821387"available to Python code as ``sys.platform``."
13831388msgstr ""
1389+ "Retorna o identificador da plataforma atual. No Unix, este identificador é "
1390+ "formado pelo nome \" oficial\" do sistema operacional, convertido para "
1391+ "minúsculas, seguido pelo número da revisão principal; por exemplo, para "
1392+ "Solaris 2.x, também conhecido como SunOS 5.x, o valor é ``'sunos5'``. No "
1393+ "macOS, é ``'darwin'``. No Windows, é ``'win'``. A string retornada aponta "
1394+ "para um armazenamento estático; o chamador não deve modificar seu valor. O "
1395+ "valor está disponível para o código Python como ``sys.platform``."
13841396
13851397#: ../../c-api/init.rst:770
13861398msgid ""
@@ -1399,6 +1411,9 @@ msgid ""
13991411"The returned string points into static storage; the caller should not modify "
14001412"its value. The value is available to Python code as ``sys.copyright``."
14011413msgstr ""
1414+ "A string retornada aponta para o armazenamento estático; o chamador não deve "
1415+ "modificar o seu valor. O valor está disponível para o código Python como "
1416+ "``sys.copyright``."
14021417
14031418#: ../../c-api/init.rst:782
14041419msgid ""
@@ -1410,14 +1425,17 @@ msgstr ""
14101425
14111426#: ../../c-api/init.rst:785
14121427msgid "\" [GCC 2.7.2.2]\" "
1413- msgstr ""
1428+ msgstr "\" [GCC 2.7.2.2] \" "
14141429
14151430#: ../../c-api/init.rst:789 ../../c-api/init.rst:803
14161431msgid ""
14171432"The returned string points into static storage; the caller should not modify "
14181433"its value. The value is available to Python code as part of the variable "
14191434"``sys.version``."
14201435msgstr ""
1436+ "A string retornada aponta para o armazenamento estático; o chamador não deve "
1437+ "modificar o seu valor. O valor está disponível para o código Python como "
1438+ "``sys.version``."
14211439
14221440#: ../../c-api/init.rst:796
14231441msgid ""
@@ -1429,7 +1447,7 @@ msgstr ""
14291447
14301448#: ../../c-api/init.rst:799
14311449msgid "\" #67, Aug 1 1997, 22:34:28\" "
1432- msgstr ""
1450+ msgstr "\" #67, Aug 1 1997, 22:34:28 \" "
14331451
14341452#: ../../c-api/init.rst:815
14351453msgid ""
@@ -1438,6 +1456,10 @@ msgid ""
14381456"should be used instead, see :ref:`Python Initialization Configuration <init-"
14391457"config>`."
14401458msgstr ""
1459+ "Esta API é mantida para compatibilidade com versões anteriores: em vez "
1460+ "disso, deve-se usar a configuração :c:member:`PyConfig.argv`, :c:member:"
1461+ "`PyConfig.parse_argv` e :c:member:`PyConfig.safe_path`, consulte :ref:"
1462+ "`Configuração de inicialização do Python <init-config>`."
14411463
14421464#: ../../c-api/init.rst:820
14431465msgid ""
@@ -1449,6 +1471,13 @@ msgid ""
14491471"empty string. If this function fails to initialize :data:`sys.argv`, a "
14501472"fatal condition is signalled using :c:func:`Py_FatalError`."
14511473msgstr ""
1474+ "Define :data:`sys.argv` com base em *argc* e *argv*. Esses parâmetros são "
1475+ "semelhantes aos passados para a função :c:func:`main` do programa, com a "
1476+ "diferença de que a primeira entrada deve se referir ao arquivo de script a "
1477+ "ser executado, em vez do executável que hospeda o interpretador Python. Se "
1478+ "não houver um script a ser executado, a primeira entrada em *argv* pode ser "
1479+ "uma string vazia. Se esta função falhar ao inicializar :data:`sys.argv`, uma "
1480+ "condição fatal será sinalizada usando :c:func:`Py_FatalError`."
14521481
14531482#: ../../c-api/init.rst:828
14541483msgid ""
@@ -1466,69 +1495,98 @@ msgid ""
14661495"path of the directory where the script is located is prepended to :data:`sys."
14671496"path`."
14681497msgstr ""
1498+ "Se o nome de um script existente for passado em ``argv[0]``, o caminho "
1499+ "absoluto do diretório onde o script está localizado será adicionado a :data:"
1500+ "`sys.path`."
14691501
14701502#: ../../c-api/init.rst:835
14711503msgid ""
14721504"Otherwise (that is, if *argc* is ``0`` or ``argv[0]`` doesn't point to an "
14731505"existing file name), an empty string is prepended to :data:`sys.path`, which "
14741506"is the same as prepending the current working directory (``\" .\" ``)."
14751507msgstr ""
1508+ "Caso contrário (isto é, se *argc* for ``0`` ou ``argv[0]`` não apontar para "
1509+ "um nome de arquivo existente), uma string vazia é adicionada ao início de :"
1510+ "data:`sys.path`, o que é o mesmo que adicionar o diretório de trabalho atual "
1511+ "(``\" .\" ``)."
14761512
14771513#: ../../c-api/init.rst:843 ../../c-api/init.rst:879
14781514msgid ""
14791515"See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv` "
14801516"members of the :ref:`Python Initialization Configuration <init-config>`."
14811517msgstr ""
1518+ "Veja também os membros :c:member:`PyConfig.orig_argv` e :c:member:`PyConfig."
1519+ "argv` da :ref:`Configuração de inicialização do Python <init-config>`."
14821520
14831521#: ../../c-api/init.rst:847
14841522msgid ""
14851523"It is recommended that applications embedding the Python interpreter for "
14861524"purposes other than executing a single script pass ``0`` as *updatepath*, "
14871525"and update :data:`sys.path` themselves if desired. See :cve:`2008-5983`."
14881526msgstr ""
1527+ "Recomenda-se que aplicações que incorporam o interpretador Python para fins "
1528+ "que não sejam a execução de um único script passem ``0`` como *updatepath*, "
1529+ "e atualizem :data:`sys.path` por conta própria, se desejarem. Veja :cve:"
1530+ "`2008-5983`."
14891531
14901532#: ../../c-api/init.rst:852
14911533msgid ""
14921534"On versions before 3.1.3, you can achieve the same effect by manually "
14931535"popping the first :data:`sys.path` element after having called :c:func:"
14941536"`PySys_SetArgv`, for example using::"
14951537msgstr ""
1538+ "Em versões anteriores à 3.1.3, você pode obter o mesmo efeito removendo "
1539+ "manualmente o primeiro elemento de :data:`sys.path` após ter chamado :c:func:"
1540+ "`PySys_SetArgv`, por exemplo, usando::"
14961541
14971542#: ../../c-api/init.rst:856
14981543msgid "PyRun_SimpleString(\" import sys; sys.path.pop(0)\\ n\" );"
1499- msgstr ""
1544+ msgstr "PyRun_SimpleString( \" import sys; sys.path.pop(0) \\ n \" ); "
15001545
15011546#: ../../c-api/init.rst:868
15021547msgid ""
15031548"This API is kept for backward compatibility: setting :c:member:`PyConfig."
15041549"argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:"
15051550"`Python Initialization Configuration <init-config>`."
15061551msgstr ""
1552+ "Esta API é mantida para retrocompatibilidade: em vez disso, devem ser usadas "
1553+ "as configurações :c:member:`PyConfig.argv` e :c:member:`PyConfig."
1554+ "parse_argv`, consulte a :ref:`Configuração de inicialização do Python <init-"
1555+ "config>`."
15071556
15081557#: ../../c-api/init.rst:872
15091558msgid ""
15101559"This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to "
15111560"``1`` unless the :program:`python` interpreter was started with the :option:"
15121561"`-I`."
15131562msgstr ""
1563+ "Esta função funciona como :c:func:`PySys_SetArgvEx` com *updatepath* "
1564+ "definido como ``1`` a menos que o interpretador :program:`python` tenha sido "
1565+ "iniciado com a :option:`-I`."
15141566
15151567#: ../../c-api/init.rst:882
15161568msgid "The *updatepath* value depends on :option:`-I`."
1517- msgstr ""
1569+ msgstr "O valor *updatepath* depende de :option:`-I`. "
15181570
15191571#: ../../c-api/init.rst:889
15201572msgid ""
15211573"This API is kept for backward compatibility: setting :c:member:`PyConfig."
15221574"home` should be used instead, see :ref:`Python Initialization Configuration "
15231575"<init-config>`."
15241576msgstr ""
1577+ "Esta API é mantida para retrocompatibilidade: em vez disso, deve-se usar a "
1578+ "configuração :c:member:`PyConfig.home`, consulte a :ref:`Configuração de "
1579+ "inicialização do Python <init-config>`."
15251580
15261581#: ../../c-api/init.rst:893
15271582msgid ""
15281583"Set the default \" home\" directory, that is, the location of the standard "
15291584"Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument "
15301585"string."
15311586msgstr ""
1587+ "Define o diretório pessoal (\" home\" ) padrão, ou seja, o local das "
1588+ "bibliotecas padrão do Python. Consulte :envvar:`PYTHONHOME` para obter o "
1589+ "significado da string do argumento."
15321590
15331591#: ../../c-api/init.rst:897
15341592msgid ""
@@ -1537,19 +1595,28 @@ msgid ""
15371595"execution. No code in the Python interpreter will change the contents of "
15381596"this storage."
15391597msgstr ""
1598+ "O argumento deve apontar para uma string terminada em zero em um "
1599+ "armazenamento estático, cujo conteúdo não será alterado durante a execução "
1600+ "do programa. Nenhum código no interpretador Python alterará o conteúdo desse "
1601+ "armazenamento."
15401602
15411603#: ../../c-api/init.rst:910
15421604msgid ""
15431605"Return the default \" home\" , that is, the value set by :c:member:`PyConfig."
15441606"home`, or the value of the :envvar:`PYTHONHOME` environment variable if it "
15451607"is set."
15461608msgstr ""
1609+ "Retorna o \" home\" padrão, ou seja, o valor definido por :c:member:`PyConfig."
1610+ "home`, ou o valor da variável de ambiente :envvar:`PYTHONHOME` se estiver "
1611+ "definida."
15471612
15481613#: ../../c-api/init.rst:920
15491614msgid ""
15501615"Use :c:func:`PyConfig_Get(\" home\" ) <PyConfig_Get>` or the :envvar:"
15511616"`PYTHONHOME` environment variable instead."
15521617msgstr ""
1618+ "Use :c:func:`PyConfig_Get(\" home\" ) <PyConfig_Get>` ou a variável de "
1619+ "ambiente :envvar:`PYTHONHOME`."
15531620
15541621#: ../../c-api/init.rst:928
15551622msgid "Thread State and the Global Interpreter Lock"
@@ -1773,7 +1840,7 @@ msgstr ""
17731840
17741841#: ../../c-api/init.rst:1038
17751842msgid "Non-Python created threads"
1776- msgstr ""
1843+ msgstr "Threads não-Python criadas "
17771844
17781845#: ../../c-api/init.rst:1040
17791846msgid ""
@@ -1784,6 +1851,12 @@ msgid ""
17841851"management), they don't hold the :term:`GIL`, because they don't have an :"
17851852"term:`attached thread state`."
17861853msgstr ""
1854+ "Quando threads são criadas usando as APIs dedicadas do Python (como o "
1855+ "módulo :mod:`threading`), um estado de thread é automaticamente associado a "
1856+ "elas e, portanto, o código mostrado acima está correto. No entanto, quando "
1857+ "threads são criadas a partir de C (por exemplo, por uma biblioteca de "
1858+ "terceiros com seu próprio gerenciamento de threads), elas não possuem a :"
1859+ "term:`GIL`, porque não têm um :term:`estado de thread anexado`."
17871860
17881861#: ../../c-api/init.rst:1047
17891862msgid ""
@@ -1794,13 +1867,22 @@ msgid ""
17941867"you are done, you should detach the :term:`thread state <attached thread "
17951868"state>`, and finally free it."
17961869msgstr ""
1870+ "Se você precisar chamar código Python a partir dessas threads (geralmente "
1871+ "isso fará parte de uma API de retorno de chamada fornecida pela biblioteca "
1872+ "de terceiros mencionada anteriormente), primeiro você deve registrar essas "
1873+ "threads com o interpretador criando um :term:`estado de thread anexado` "
1874+ "antes de começar a usar a API C/Python. Quando terminar, você deve desanexar "
1875+ "o :term:`estado de thread <attached thread state>` e, finalmente, liberá-lo."
17971876
17981877#: ../../c-api/init.rst:1054
17991878msgid ""
18001879"The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions "
18011880"do all of the above automatically. The typical idiom for calling into "
18021881"Python from a C thread is::"
18031882msgstr ""
1883+ "As funções :c:func:`PyGILState_Ensure` e :c:func:`PyGILState_Release` fazem "
1884+ "tudo isso automaticamente. O padrão típico para chamar o Python a partir de "
1885+ "uma thread C é:"
18041886
18051887#: ../../c-api/init.rst:1058
18061888msgid ""
@@ -1814,6 +1896,15 @@ msgid ""
18141896"/* Release the thread. No Python API allowed beyond this point. */\n"
18151897"PyGILState_Release(gstate);"
18161898msgstr ""
1899+ "PyGILState_STATE gstate;\n"
1900+ "gstate = PyGILState_Ensure();\n"
1901+ "\n"
1902+ "/* Executa ações do Python aqui. */\n"
1903+ "result = ChamaAlgumaFunção();\n"
1904+ "/* avalia resultado ou trata de exceção */\n"
1905+ "\n"
1906+ "/* Libera a thread. Na API do Python permitida além deste ponto. */\n"
1907+ "PyGILState_Release(gstate);"
18171908
18181909#: ../../c-api/init.rst:1068
18191910msgid ""
@@ -1827,24 +1918,39 @@ msgid ""
18271918"meaning that the thread can't safely interact with the calling "
18281919"subinterpreter."
18291920msgstr ""
1921+ "Note que as funções ``PyGILState_*`` pressupõem a existência de apenas um "
1922+ "interpretador global (criado automaticamente por :c:func:`Py_Initialize`). O "
1923+ "Python oferece suporte à criação de interpretadores adicionais (usando :c:"
1924+ "func:`Py_NewInterpreter`), mas a combinação de múltiplos interpretadores com "
1925+ "a API ``PyGILState_*`` não é suportada. Isso ocorre porque :c:func:"
1926+ "`PyGILState_Ensure` e funções similares, por padrão, :term:`anexam <attached "
1927+ "thread state>` um :term:`estado de thread` para o interpretador principal, o "
1928+ "que significa que a thread não pode interagir de forma segura com o "
1929+ "subinterpretador que a chamou."
18301930
18311931#: ../../c-api/init.rst:1078
18321932msgid "Supporting subinterpreters in non-Python threads"
1833- msgstr ""
1933+ msgstr "Suporte a subinterpretadores em threads não-Python "
18341934
18351935#: ../../c-api/init.rst:1080
18361936msgid ""
18371937"If you would like to support subinterpreters with non-Python created "
18381938"threads, you must use the ``PyThreadState_*`` API instead of the traditional "
18391939"``PyGILState_*`` API."
18401940msgstr ""
1941+ "Se você deseja oferecer suporte a subinterpretadores com threads que não "
1942+ "foram criadas pelo Python, você deve usar a API ``PyThreadState_*`` em vez "
1943+ "da API tradicional ``PyGILState_*``."
18411944
18421945#: ../../c-api/init.rst:1084
18431946msgid ""
18441947"In particular, you must store the interpreter state from the calling "
18451948"function and pass it to :c:func:`PyThreadState_New`, which will ensure that "
18461949"the :term:`thread state` is targeting the correct interpreter::"
18471950msgstr ""
1951+ "Em particular, você deve armazenar o estado do interpretador da função que a "
1952+ "chamou e passá-lo para :c:func:`PyThreadState_New`, o que garantirá que o :"
1953+ "term:`estado de thread` esteja direcionado para o interpretador correto::"
18481954
18491955#: ../../c-api/init.rst:1088
18501956msgid ""
@@ -1863,6 +1969,20 @@ msgid ""
18631969"PyThreadState_Clear(tstate);\n"
18641970"PyThreadState_DeleteCurrent();"
18651971msgstr ""
1972+ "/* O valor de retorno de PyInterpreterState_Get()\n"
1973+ " da função que criou esta thread. */\n"
1974+ "PyInterpreterState *interp = ThreadData->interp;\n"
1975+ "PyThreadState *tstate = PyThreadState_New(interp);\n"
1976+ "PyThreadState_Swap(tstate);\n"
1977+ "\n"
1978+ "/* GIL do subinterpretador é agora retido.\n"
1979+ " Executa ações do Python aqui. */\n"
1980+ "result = ChamaAlgumaFunção();\n"
1981+ "/* avalia resultado ou trata a execução */\n"
1982+ "\n"
1983+ "/* Destroy the thread state. No Python API allowed beyond this point. */\n"
1984+ "PyThreadState_Clear(tstate);\n"
1985+ "PyThreadState_DeleteCurrent();"
18661986
18671987#: ../../c-api/init.rst:1106
18681988msgid "Cautions about fork()"
@@ -1876,6 +1996,12 @@ msgid ""
18761996"concrete impact both on how locks must be handled and on all stored state in "
18771997"CPython's runtime."
18781998msgstr ""
1999+ "Outro aspecto importante a observar sobre threads é o seu comportamento "
2000+ "diante da chamada de :c:func:`fork` da linguagem C. Na maioria dos sistemas "
2001+ "com :c:func:`fork`, após um processo ser criado (\" fork\" ), apenas a thread "
2002+ "que emitiu o fork continuará existindo. Isso tem um impacto concreto tanto "
2003+ "na forma como as travas devem ser gerenciados quanto em todo o estado "
2004+ "armazenado no ambiente de execução do CPython."
18792005
18802006#: ../../c-api/init.rst:1114
18812007msgid ""
0 commit comments