@@ -2005,18 +2005,21 @@ msgstr "``PATH`` 环境变量用于获取程序的完整路径 (来自 :c:member
20052005
20062006#: ../../c-api/init_config.rst:1457
20072007msgid "``__PYVENV_LAUNCHER__`` environment variable"
2008- msgstr ""
2008+ msgstr "``__PYVENV_LAUNCHER__`` 环境变量 "
20092009
20102010#: ../../c-api/init_config.rst:1458
20112011msgid ""
20122012"(Windows only) Application paths in the registry under "
20132013"\" Software\\ Python\\ PythonCore\\ X.Y\\ PythonPath\" of HKEY_CURRENT_USER and "
20142014"HKEY_LOCAL_MACHINE (where X.Y is the Python version)."
20152015msgstr ""
2016+ "(仅限 Windows only) 注册表 HKEY_CURRENT_USER 和 HKEY_LOCAL_MACHINE 的 "
2017+ "\" Software\\ Python\\ PythonCore\\ X.Y\\ PythonPath\" 项下的应用程序目录(其中 X.Y 为 Python "
2018+ "版本)。"
20162019
20172020#: ../../c-api/init_config.rst:1462
20182021msgid "Path configuration output fields:"
2019- msgstr ""
2022+ msgstr "路径配置输出字段: "
20202023
20212024#: ../../c-api/init_config.rst:1464
20222025msgid ":c:member:`PyConfig.base_exec_prefix`"
@@ -2058,6 +2061,10 @@ msgid ""
20582061":c:member:`~PyConfig.module_search_paths` is overridden and "
20592062":c:member:`~PyConfig.module_search_paths_set` is set to ``1``."
20602063msgstr ""
2064+ "如果至少有一个“输出字段”未被设置,Python 就会计算路径配置来填充未设置的字段。 如果 "
2065+ ":c:member:`~PyConfig.module_search_paths_set` 等于 ``0``,则 "
2066+ ":c:member:`~PyConfig.module_search_paths` 将被覆盖并且 "
2067+ ":c:member:`~PyConfig.module_search_paths_set` 将被设置为 ``1``。"
20612068
20622069#: ../../c-api/init_config.rst:1479
20632070msgid ""
@@ -2068,13 +2075,18 @@ msgid ""
20682075"is set to ``1``. In this case, ``module_search_paths`` will be used without "
20692076"modification."
20702077msgstr ""
2078+ "通过显式地设置上述所有路径配置输出字段可以完全忽略计算默认路径配置的函数。 即使字符串不为空也会被视为已设置。 如果 "
2079+ "``module_search_paths_set`` 被设为 ``1`` 则 ``module_search_paths`` 会被视为已设置。 "
2080+ "在这种情况下,``module_search_paths`` 将不加修改地被使用。"
20712081
20722082#: ../../c-api/init_config.rst:1486
20732083msgid ""
20742084"Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings "
20752085"when calculating the path configuration (Unix only, Windows does not log any"
20762086" warning)."
20772087msgstr ""
2088+ "将 :c:member:`~PyConfig.pathconfig_warnings` 设为 ``0`` 以便在计算路径配置时抑制警告(仅限 "
2089+ "Unix,Windows 不会记录任何警告)。"
20782090
20792091#: ../../c-api/init_config.rst:1489
20802092msgid ""
@@ -2083,37 +2095,45 @@ msgid ""
20832095"their value from :c:member:`~PyConfig.prefix` and "
20842096":c:member:`~PyConfig.exec_prefix` respectively."
20852097msgstr ""
2098+ "如果 :c:member:`~PyConfig.base_prefix` 或 "
2099+ ":c:member:`~PyConfig.base_exec_prefix` 字段未设置,它们将分别从 "
2100+ ":c:member:`~PyConfig.prefix` 和 :c:member:`~PyConfig.exec_prefix` 继承其值。"
20862101
20872102#: ../../c-api/init_config.rst:1493
20882103msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:"
2089- msgstr ""
2104+ msgstr ":c:func:`Py_RunMain` 和 :c:func:`Py_Main` 将修改 :data:`sys.path`: "
20902105
20912106#: ../../c-api/init_config.rst:1495
20922107msgid ""
20932108"If :c:member:`~PyConfig.run_filename` is set and is a directory which "
20942109"contains a ``__main__.py`` script, prepend "
20952110":c:member:`~PyConfig.run_filename` to :data:`sys.path`."
20962111msgstr ""
2112+ "如果 :c:member:`~PyConfig.run_filename` 已设置并且是一个包含 ``__main__.py`` 脚本的目录,则会将 "
2113+ ":c:member:`~PyConfig.run_filename` 添加到 :data:`sys.path` 的开头。"
20972114
20982115#: ../../c-api/init_config.rst:1498
20992116msgid "If :c:member:`~PyConfig.isolated` is zero:"
2100- msgstr ""
2117+ msgstr "如果 :c:member:`~PyConfig.isolated` 为零: "
21012118
21022119#: ../../c-api/init_config.rst:1500
21032120msgid ""
21042121"If :c:member:`~PyConfig.run_module` is set, prepend the current directory to"
21052122" :data:`sys.path`. Do nothing if the current directory cannot be read."
21062123msgstr ""
2124+ "如果设置了 :c:member:`~PyConfig.run_module`,则将当前目录添加到 :data:`sys.path` 的开头。 "
2125+ "如果无法读取当前目录则不执行任何操作。"
21072126
21082127#: ../../c-api/init_config.rst:1502
21092128msgid ""
21102129"If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the "
21112130"filename to :data:`sys.path`."
21122131msgstr ""
2132+ "如果设置了 :c:member:`~PyConfig.run_filename`,则将文件名的目录添加到 :data:`sys.path` 的开头。"
21132133
21142134#: ../../c-api/init_config.rst:1504
21152135msgid "Otherwise, prepend an empty string to :data:`sys.path`."
2116- msgstr ""
2136+ msgstr "在其他情况下,则将一个空字符串添加到 :data:`sys.path` 的开头。 "
21172137
21182138#: ../../c-api/init_config.rst:1506
21192139msgid ""
@@ -2123,52 +2143,56 @@ msgid ""
21232143"package directory exists, the :mod:`site` module appends the user's site-"
21242144"package directory to :data:`sys.path`."
21252145msgstr ""
2146+ "如果 :c:member:`~PyConfig.site_import` 为非零值,则 :data:`sys.path` 可通过 :mod:`site`"
2147+ " 模块修改。 如果 :c:member:`~PyConfig.user_site_directory` 为非零值且用户的 site-package "
2148+ "目录存在,则 :mod:`site` 模块会将用户的 site-package 目录附加到 :data:`sys.path`。"
21262149
21272150#: ../../c-api/init_config.rst:1512
21282151msgid "The following configuration files are used by the path configuration:"
2129- msgstr ""
2152+ msgstr "路径配置会使用以下配置文件: "
21302153
21312154#: ../../c-api/init_config.rst:1514
21322155msgid "``pyvenv.cfg``"
21332156msgstr "``pyvenv.cfg``"
21342157
21352158#: ../../c-api/init_config.rst:1515
21362159msgid "``._pth`` file (ex: ``python._pth``)"
2137- msgstr ""
2160+ msgstr "``._pth`` 文件 (例如: ``python._pth``) "
21382161
21392162#: ../../c-api/init_config.rst:1516
21402163msgid "``pybuilddir.txt`` (Unix only)"
21412164msgstr "``pybuilddir.txt`` (仅Unix)"
21422165
21432166#: ../../c-api/init_config.rst:1518
21442167msgid "If a ``._pth`` file is present:"
2145- msgstr ""
2168+ msgstr "如果存在 ``._pth`` 文件: "
21462169
21472170#: ../../c-api/init_config.rst:1520
21482171msgid "Set :c:member:`~PyConfig.isolated` to ``1``."
2149- msgstr ""
2172+ msgstr "将 :c:member:`~PyConfig.isolated` 设为 ``1``。 "
21502173
21512174#: ../../c-api/init_config.rst:1521
21522175msgid "Set :c:member:`~PyConfig.use_environment` to ``0``."
2153- msgstr ""
2176+ msgstr "将 :c:member:`~PyConfig.use_environment` 设为 ``0``。 "
21542177
21552178#: ../../c-api/init_config.rst:1522
21562179msgid "Set :c:member:`~PyConfig.site_import` to ``0``."
2157- msgstr ""
2180+ msgstr "将 :c:member:`~PyConfig.site_import` 设为 ``0``。 "
21582181
21592182#: ../../c-api/init_config.rst:1523
21602183msgid "Set :c:member:`~PyConfig.safe_path` to ``1``."
2161- msgstr ""
2184+ msgstr "将 :c:member:`~PyConfig.safe_path` 设为 ``1``。 "
21622185
21632186#: ../../c-api/init_config.rst:1525
21642187msgid ""
21652188"The ``__PYVENV_LAUNCHER__`` environment variable is used to set "
21662189":c:member:`PyConfig.base_executable`"
21672190msgstr ""
2191+ "``__PYVENV_LAUNCHER__`` 环境变量将被用于设置 :c:member:`PyConfig.base_executable`"
21682192
21692193#: ../../c-api/init_config.rst:1530
21702194msgid "Py_RunMain()"
2171- msgstr ""
2195+ msgstr "Py_RunMain() "
21722196
21732197#: ../../c-api/init_config.rst:1534
21742198msgid ""
@@ -2177,98 +2201,102 @@ msgid ""
21772201"(:c:member:`PyConfig.run_module`) specified on the command line or in the "
21782202"configuration."
21792203msgstr ""
2204+ "执行在命令行或配置中指定的命令 (:c:member:`PyConfig.run_command`)、脚本 "
2205+ "(:c:member:`PyConfig.run_filename`) 或模块 (:c:member:`PyConfig.run_module`)。"
21802206
21812207#: ../../c-api/init_config.rst:1539
21822208msgid "By default and when if :option:`-i` option is used, run the REPL."
2183- msgstr ""
2209+ msgstr "在默认情况下如果使用了 :option:`-i` 选项,则运行 REPL。 "
21842210
21852211#: ../../c-api/init_config.rst:1541
21862212msgid ""
21872213"Finally, finalizes Python and returns an exit status that can be passed to "
21882214"the ``exit()`` function."
2189- msgstr ""
2215+ msgstr "最后,终结化 Python 并返回一个可传递给 ``exit()`` 函数的退出状态。 "
21902216
21912217#: ../../c-api/init_config.rst:1544
21922218msgid ""
21932219"See :ref:`Python Configuration <init-python-config>` for an example of "
21942220"customized Python always running in isolated mode using "
21952221":c:func:`Py_RunMain`."
21962222msgstr ""
2223+ "请参阅 :ref:`Python 配置 <init-python-config>` 查看一个使用 :c:func:`Py_RunMain` "
2224+ "在隔离模式下始终运行自定义 Python 的示例。"
21972225
21982226#: ../../c-api/init_config.rst:1550
21992227msgid "Py_GetArgcArgv()"
2200- msgstr ""
2228+ msgstr "Py_GetArgcArgv() "
22012229
22022230#: ../../c-api/init_config.rst:1554
22032231msgid "Get the original command line arguments, before Python modified them."
2204- msgstr ""
2232+ msgstr "在 Python 修改原始命令行参数之前,获取这些参数。 "
22052233
22062234#: ../../c-api/init_config.rst:1556
22072235msgid "See also :c:member:`PyConfig.orig_argv` member."
2208- msgstr ""
2236+ msgstr "另请参阅 :c:member:`PyConfig.orig_argv` 成员。 "
22092237
22102238#: ../../c-api/init_config.rst:1560
22112239msgid "Multi-Phase Initialization Private Provisional API"
2212- msgstr ""
2240+ msgstr "多阶段初始化私有暂定 API "
22132241
22142242#: ../../c-api/init_config.rst:1562
22152243msgid ""
22162244"This section is a private provisional API introducing multi-phase "
22172245"initialization, the core feature of :pep:`432`:"
2218- msgstr ""
2246+ msgstr "本节介绍的私有暂定 API 引入了多阶段初始化,它是 :pep:`432` 的核心特性: "
22192247
22202248#: ../../c-api/init_config.rst:1565
22212249msgid "\" Core\" initialization phase, \" bare minimum Python\" :"
2222- msgstr ""
2250+ msgstr "“核心”初始化阶段,“最小化的基本 Python”: "
22232251
22242252#: ../../c-api/init_config.rst:1567
22252253msgid "Builtin types;"
2226- msgstr ""
2254+ msgstr "内置类型; "
22272255
22282256#: ../../c-api/init_config.rst:1568
22292257msgid "Builtin exceptions;"
2230- msgstr ""
2258+ msgstr "内置异常; "
22312259
22322260#: ../../c-api/init_config.rst:1569
22332261msgid "Builtin and frozen modules;"
2234- msgstr ""
2262+ msgstr "内置和已冻结模块; "
22352263
22362264#: ../../c-api/init_config.rst:1570
22372265msgid ""
22382266"The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` "
22392267"doesn't exist yet)."
2240- msgstr ""
2268+ msgstr ":mod:`sys` 模块仅部分初始化(例如: :data:`sys.path` 尚不存在)。 "
22412269
22422270#: ../../c-api/init_config.rst:1573
22432271msgid "\" Main\" initialization phase, Python is fully initialized:"
2244- msgstr ""
2272+ msgstr "\" 主要 \" 初始化阶段,Python 被完全初始化: "
22452273
22462274#: ../../c-api/init_config.rst:1575
22472275msgid "Install and configure :mod:`importlib`;"
2248- msgstr ""
2276+ msgstr "安装并配置 :mod:`importlib`; "
22492277
22502278#: ../../c-api/init_config.rst:1576
22512279msgid "Apply the :ref:`Path Configuration <init-path-config>`;"
2252- msgstr ""
2280+ msgstr "应用 :ref:`路径配置 <init-path-config>`; "
22532281
22542282#: ../../c-api/init_config.rst:1577
22552283msgid "Install signal handlers;"
2256- msgstr ""
2284+ msgstr "安装信号处理句柄; "
22572285
22582286#: ../../c-api/init_config.rst:1578
22592287msgid ""
22602288"Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and "
22612289":data:`sys.path`);"
2262- msgstr ""
2290+ msgstr "完成 :mod:`sys` 模块初始化 (例如:创建 :data:`sys.stdout` 和 :data:`sys.path`); "
22632291
22642292#: ../../c-api/init_config.rst:1580
22652293msgid ""
22662294"Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;"
2267- msgstr ""
2295+ msgstr "启用 :mod:`faulthandler` 和 :mod:`tracemalloc` 等可选功能; "
22682296
22692297#: ../../c-api/init_config.rst:1581
22702298msgid "Import the :mod:`site` module;"
2271- msgstr ""
2299+ msgstr "导入 :mod:`site` 模块; "
22722300
22732301#: ../../c-api/init_config.rst:1582
22742302msgid "etc."
@@ -2284,11 +2312,13 @@ msgid ""
22842312":c:func:`Py_InitializeFromConfig` stops at the \" Core\" initialization "
22852313"phase."
22862314msgstr ""
2315+ ":c:member:`PyConfig._init_main`: 如果设为 "
2316+ "``0``,:c:func:`Py_InitializeFromConfig` 将在“核心”初始化阶段停止。"
22872317
22882318#: ../../c-api/init_config.rst:1591
22892319msgid ""
22902320"Move to the \" Main\" initialization phase, finish the Python initialization."
2291- msgstr ""
2321+ msgstr "进入“主要”初始化阶段,完成 Python 初始化。 "
22922322
22932323#: ../../c-api/init_config.rst:1593
22942324msgid ""
@@ -2299,13 +2329,18 @@ msgid ""
22992329" maybe install a custom :data:`sys.meta_path` importer or an import hook, "
23002330"etc."
23012331msgstr ""
2332+ "在“核心”阶段不会导入任何模块,也不会配置 ``importlib`` 模块: :ref:`路径配置 <init-path-config>` "
2333+ "只会在“主要”阶段期间应用。 这可能允许在 Python 中定制 Python 以覆盖或微调 :ref:`路径配置 <init-path-"
2334+ "config>`,也可能会安装自定义的 :data:`sys.meta_path` 导入器或导入钩子等等。"
23022335
23032336#: ../../c-api/init_config.rst:1599
23042337msgid ""
23052338"It may become possible to calculate the :ref:`Path Configuration <init-path-"
23062339"config>` in Python, after the Core phase and before the Main phase, which is"
23072340" one of the :pep:`432` motivation."
23082341msgstr ""
2342+ "在核心阶段之后主要阶段之前,将有可能在 Python 中计算 :ref:`路径配置 <init-path-config>`,这是 :pep:`432` "
2343+ "的动机之一。"
23092344
23102345#: ../../c-api/init_config.rst:1603
23112346msgid ""
@@ -2319,4 +2354,4 @@ msgstr ""
23192354msgid ""
23202355"Example running Python code between \" Core\" and \" Main\" initialization "
23212356"phases::"
2322- msgstr ""
2357+ msgstr "在“核心”和“主要”初始化阶段之间运行 Python 代码的示例:: "
0 commit comments