@@ -2188,13 +2188,13 @@ msgstr ""
21882188
21892189#: ../../library/sys.rst:1357
21902190msgid "For more information on code and frame objects, refer to :ref:`types`."
2191- msgstr ""
2191+ msgstr "关于代码对象和帧对象的更多信息请参考 :ref:`types`。 "
21922192
21932193#: ../../library/sys.rst:1360
21942194msgid ""
21952195"Raises an :ref:`auditing event <auditing>` ``sys.settrace`` with no "
21962196"arguments."
2197- msgstr ""
2197+ msgstr "引发一个 :ref:`审计事件 <auditing>` ``sys.settrace``,不附带任何参数。 "
21982198
21992199#: ../../library/sys.rst:1363
22002200msgid ""
@@ -2203,12 +2203,16 @@ msgid ""
22032203"implementation platform, rather than part of the language definition, and "
22042204"thus may not be available in all Python implementations."
22052205msgstr ""
2206+ ":func:`settrace` 函数仅用于实现调试器,性能分析器,打包工具等。它的行为是实现平台的一部分,而不是语言定义的一部分,因此并非在所有 "
2207+ "Python 实现中都可用。"
22062208
22072209#: ../../library/sys.rst:1370
22082210msgid ""
22092211"``'opcode'`` event type added; :attr:`f_trace_lines` and "
22102212":attr:`f_trace_opcodes` attributes added to frames"
22112213msgstr ""
2214+ "添加了 ``'opcode'`` 事件类型;为帧对象添加了 :attr:`f_trace_lines` 和 "
2215+ ":attr:`f_trace_opcodes` 属性。"
22122216
22132217#: ../../library/sys.rst:1375
22142218msgid ""
@@ -2218,31 +2222,38 @@ msgid ""
22182222"first time. The *finalizer* will be called when an asynchronous generator is"
22192223" about to be garbage collected."
22202224msgstr ""
2225+ "接受两个可选的关键字参数,要求它们是可调用对象,且接受一个 :term:`异步生成器迭代器 <asynchronous generator "
2226+ "iterator>` 作为参数。*firstiter* 对象将在异步生成器第一次迭代时调用。*finalizer* 将在异步生成器即将被销毁时调用。"
22212227
22222228#: ../../library/sys.rst:1382
22232229msgid ""
22242230"Raises an :ref:`auditing event <auditing>` "
22252231"``sys.set_asyncgen_hooks_firstiter`` with no arguments."
22262232msgstr ""
2233+ "引发一个 :ref:`审计事件 <auditing>` ``sys.set_asyncgen_hooks_firstiter``,不附带任何参数。"
22272234
22282235#: ../../library/sys.rst:1384
22292236msgid ""
22302237"Raises an :ref:`auditing event <auditing>` "
22312238"``sys.set_asyncgen_hooks_finalizer`` with no arguments."
22322239msgstr ""
2240+ "引发一个 :ref:`审计事件 <auditing>` ``sys.set_asyncgen_hooks_finalizer``,不附带任何参数。"
22332241
22342242#: ../../library/sys.rst:1385
22352243msgid ""
22362244"Two auditing events are raised because the underlying API consists of two "
22372245"calls, each of which must raise its own event."
2238- msgstr ""
2246+ msgstr "之所以会引发两个审计事件,是因为底层的 API 由两个调用组成,每个调用都须要引发自己的事件。 "
22392247
22402248#: ../../library/sys.rst:1388
22412249msgid ""
22422250"See :pep:`525` for more details, and for a reference example of a "
22432251"*finalizer* method see the implementation of "
22442252"``asyncio.Loop.shutdown_asyncgens`` in :source:`Lib/asyncio/base_events.py`"
22452253msgstr ""
2254+ "更多详情请参阅 :pep:`525`,*finalizer* 方法的参考示例可参阅 "
2255+ ":source:`Lib/asyncio/base_events.py` 中 ``asyncio.Loop.shutdown_asyncgens`` "
2256+ "的实现。"
22462257
22472258#: ../../library/sys.rst:1400
22482259msgid ""
@@ -2252,30 +2263,33 @@ msgid ""
22522263" the coroutine object was created, with the most recent call first. When "
22532264"disabled, ``cr_origin`` will be None."
22542265msgstr ""
2266+ "用于启用或禁用协程溯源。启用后,协程对象上的 ``cr_origin`` 属性将包含一个元组,它由多个(文件名 filename,行号 line "
2267+ "number,函数名 function "
2268+ "name)元组组成,整个元组描述出了协程对象创建过程的回溯,元组首端是最近一次的调用。禁用后,``cr_origin`` 将为 None。"
22552269
22562270#: ../../library/sys.rst:1407
22572271msgid ""
22582272"To enable, pass a *depth* value greater than zero; this sets the number of "
22592273"frames whose information will be captured. To disable, pass set *depth* to "
22602274"zero."
2261- msgstr ""
2275+ msgstr "要启用,请向 *depth* 传递一个大于零的值,它指定了有多少帧将被捕获信息。要禁用,请将 *depth* 置为零。 "
22622276
22632277#: ../../library/sys.rst:1411
22642278msgid "This setting is thread-specific."
2265- msgstr ""
2279+ msgstr "该设置是特定于单个线程的。 "
22662280
22672281#: ../../library/sys.rst:1421
22682282msgid ""
22692283"Changes the default filesystem encoding and errors mode to 'mbcs' and "
22702284"'replace' respectively, for consistency with versions of Python prior to "
22712285"3.6."
2272- msgstr ""
2286+ msgstr "将默认文件系统编码和错误处理方案分别更改为 'mbcs' 和 'replace',这是为了与 Python 3.6 前的版本保持一致。 "
22732287
22742288#: ../../library/sys.rst:1424
22752289msgid ""
22762290"This is equivalent to defining the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` "
22772291"environment variable before launching Python."
2278- msgstr ""
2292+ msgstr "这等同于在启动 Python 前先定义好 :envvar:`PYTHONLEGACYWINDOWSFSENCODING` 环境变量。 "
22792293
22802294#: ../../library/sys.rst:1429
22812295msgid "See :pep:`529` for more details."
@@ -2285,35 +2299,39 @@ msgstr "有关更多详细信息,请参阅 :pep:`529`。"
22852299msgid ""
22862300":term:`File objects <file object>` used by the interpreter for standard "
22872301"input, output and errors:"
2288- msgstr ""
2302+ msgstr "解释器用于标准输入、标准输出和标准错误的 :term:`文件对象 <file object>`: "
22892303
22902304#: ../../library/sys.rst:1439
22912305msgid ""
22922306"``stdin`` is used for all interactive input (including calls to "
22932307":func:`input`);"
2294- msgstr ""
2308+ msgstr "``stdin`` 用于所有交互式输入(包括对 :func:`input` 的调用); "
22952309
22962310#: ../../library/sys.rst:1441
22972311msgid ""
22982312"``stdout`` is used for the output of :func:`print` and :term:`expression` "
22992313"statements and for the prompts of :func:`input`;"
23002314msgstr ""
2315+ "``stdout`` 用于 :func:`print` 和 :term:`expression` 语句的输出,以及用于 :func:`input` "
2316+ "的提示符;"
23012317
23022318#: ../../library/sys.rst:1443
23032319msgid "The interpreter's own prompts and its error messages go to ``stderr``."
2304- msgstr ""
2320+ msgstr "解释器自身的提示符和它的错误消息都发往 ``stderr``。 "
23052321
23062322#: ../../library/sys.rst:1445
23072323msgid ""
23082324"These streams are regular :term:`text files <text file>` like those returned"
23092325" by the :func:`open` function. Their parameters are chosen as follows:"
2310- msgstr ""
2326+ msgstr "这些流都是常规 :term:`文本文件 <text file>`,与 :func:`open` 函数返回的对象一致。它们的参数选择如下: "
23112327
23122328#: ../../library/sys.rst:1449
23132329msgid ""
23142330"The character encoding is platform-dependent. Non-Windows platforms use the"
23152331" locale encoding (see :meth:`locale.getpreferredencoding()`)."
23162332msgstr ""
2333+ "字符编码取决于各个平台。在非 Windows 平台上使用的是语言环境 (locale) 编码(可参阅 "
2334+ ":meth:`locale.getpreferredencoding()` )。"
23172335
23182336#: ../../library/sys.rst:1453
23192337msgid ""
@@ -2325,13 +2343,18 @@ msgid ""
23252343"defaults to the system locale encoding if the process is not initially "
23262344"attached to a console."
23272345msgstr ""
2346+ "在 Windows 上,控制台设备使用 UTF-8 编码。非字符设备(如磁盘文件和管道)使用系统语言环境编码(即 ANSI "
2347+ "代码页)。非控制台字符设备(即 ``isatty()`` 返回的是 ``True``,如 NUL)在启动时,会把控制台输入代码页和输出代码页的值分别用于"
2348+ " stdin 和 stdout/stderr。如果进程原本没有附加到控制台,则默认为系统语言环境编码。"
23282349
23292350#: ../../library/sys.rst:1462
23302351msgid ""
23312352"The special behaviour of the console can be overridden by setting the "
23322353"environment variable PYTHONLEGACYWINDOWSSTDIO before starting Python. In "
23332354"that case, the console codepages are used as for any other character device."
23342355msgstr ""
2356+ "要重写控制台的特殊行为,可以在启动 Python 前设置 PYTHONLEGACYWINDOWSSTDIO "
2357+ "环境变量。此时,控制台代码页将用于其他字符设备。"
23352358
23362359#: ../../library/sys.rst:1467
23372360msgid ""
@@ -2342,6 +2365,9 @@ msgid ""
23422365"console, this only applies when :envvar:`PYTHONLEGACYWINDOWSSTDIO` is also "
23432366"set."
23442367msgstr ""
2368+ "在所有平台上,都可以通过在 Python 启动前设置 :envvar:`PYTHONIOENCODING` 环境变量来重写字符编码,或通过新的 "
2369+ ":option:`-X` ``utf8`` 命令行选项和 :envvar:`PYTHONUTF8` 环境变量来设置。但是,对 Windows "
2370+ "控制台来说,上述方法仅在设置了 :envvar:`PYTHONLEGACYWINDOWSSTDIO` 后才起效。"
23452371
23462372#: ../../library/sys.rst:1474
23472373msgid ""
0 commit comments