From 64d1156bbcfd7b0adeacd7475b7b3b49e2815be5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 12 Jul 2025 11:07:48 +0000 Subject: [PATCH 1/7] Initial plan From 502b66fef2ac969c75d933d7e886f89a8a580d7a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 12 Jul 2025 11:12:38 +0000 Subject: [PATCH 2/7] Translate initial sys.po sections: module intro, argv, audit functions Co-authored-by: josix <18432820+josix@users.noreply.github.com> --- library/sys.po | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/sys.po b/library/sys.po index 4a3bf4a219..57ec9ee7a8 100644 --- a/library/sys.po +++ b/library/sys.po @@ -30,18 +30,21 @@ msgid "" "is always available. Unless explicitly noted otherwise, all variables are " "read-only." msgstr "" +"此模組提供存取一些由直譯器使用或維護的變數,以及與直譯器強烈互動的函式。它總是可用的。除非明確說明,否則所有變數都是唯讀的。" #: ../../library/sys.rst:16 msgid "" "On POSIX systems where Python was built with the standard ``configure`` " "script, this contains the ABI flags as specified by :pep:`3149`." msgstr "" +"在使用標準 ``configure`` 指令碼建置 Python 的 POSIX 系統上,這包含 :pep:`3149` 中規定的 ABI 旗標。" #: ../../library/sys.rst:21 msgid "" "Default flags became an empty string (``m`` flag for pymalloc has been " "removed)." msgstr "" +"預設旗標變成空字串(pymalloc 的 ``m`` 旗標已被移除)。" #: ../../library/sys.rst:25 ../../library/sys.rst:299 ../../library/sys.rst:369 #: ../../library/sys.rst:760 ../../library/sys.rst:778 @@ -57,6 +60,7 @@ msgid "" "Append the callable *hook* to the list of active auditing hooks for the " "current (sub)interpreter." msgstr "" +"將可呼叫的 *hook* 附加到目前(子)直譯器的活躍稽核 hook 清單中。" #: ../../library/sys.rst:33 msgid "" @@ -67,6 +71,7 @@ msgid "" "Hooks can then log the event, raise an exception to abort the operation, or " "terminate the process entirely." msgstr "" +"當稽核事件透過 :func:`sys.audit` 函式引發時,每個 hook 都會按照其新增的順序被呼叫,並傳入事件名稱和引數元組。由 :c:func:`PySys_AddAuditHook` 新增的原生 hook 會先被呼叫,接著是在目前(子)直譯器中新增的 hook。Hook 可以記錄事件、引發例外以中止操作,或完全終止程序。" #: ../../library/sys.rst:40 msgid "" @@ -79,6 +84,7 @@ msgid "" "runtime, and any modules allowing arbitrary memory modification (such as :" "mod:`ctypes`) should be completely removed or closely monitored." msgstr "" +"請注意稽核 hook 主要是用來收集關於內部或其他無法觀察的操作的資訊,無論是由 Python 或以 Python 撰寫的函式庫執行的。它們不適合用來實作「沙盒」。特別是,惡意程式碼可以輕易地停用或繞過使用此函式新增的 hook。至少,任何安全敏感的 hook 必須在初始化執行時期之前使用 C API :c:func:`PySys_AddAuditHook` 新增,而任何允許任意記憶體修改的模組(例如 :mod:`ctypes`)應該被完全移除或密切監控。" #: ../../library/sys.rst:49 ../../library/sys.rst:51 msgid "" @@ -106,6 +112,7 @@ msgid "" "Exceptions derived from :class:`Exception` but not :class:`RuntimeError` are " "no longer suppressed." msgstr "" +"衍生自 :class:`Exception` 但非 :class:`RuntimeError` 的例外不再被抑制。" #: ../../library/sys.rst:70 msgid "" @@ -113,6 +120,7 @@ msgid "" "if the callable has a ``__cantrace__`` member that is set to a true value. " "Otherwise, trace functions will skip the hook." msgstr "" +"當追蹤功能啟用時(參閱 :func:`settrace`),Python hook 只有在可呼叫物件具有設定為真值的 ``__cantrace__`` 成員時才會被追蹤。否則,追蹤函式會跳過該 hook。" #: ../../library/sys.rst:77 msgid "" @@ -123,6 +131,7 @@ msgid "" "c'``. If no script name was passed to the Python interpreter, ``argv[0]`` " "is the empty string." msgstr "" +"傳遞給 Python 指令碼的命令列引數清單。``argv[0]`` 是指令碼名稱(這是否為完整路徑取決於作業系統)。如果命令是使用直譯器的 :option:`-c` 命令列選項執行的,``argv[0]`` 會被設定為字串 ``'-c'``。如果沒有將指令碼名稱傳遞給 Python 直譯器,``argv[0]`` 是空字串。" #: ../../library/sys.rst:83 msgid "" @@ -141,6 +150,7 @@ msgid "" "you need original bytes, you can get it by ``[os.fsencode(arg) for arg in " "sys.argv]``." msgstr "" +"在 Unix 上,命令列引數會以位元組形式從作業系統傳遞。Python 使用檔案系統編碼和 \"surrogateescape\" 錯誤處理器來解碼它們。當你需要原始位元組時,可以透過 ``[os.fsencode(arg) for arg in sys.argv]`` 來取得。" #: ../../library/sys.rst:101 msgid "" @@ -150,6 +160,7 @@ msgid "" "given event are considered a public and stable API and should not be " "modified between releases." msgstr "" +"引發一個稽核事件並觸發任何活躍的稽核 hook。*event* 是識別事件的字串,*args* 可能包含關於該事件更多資訊的選擇性引數。給定事件的引數數量和型別被視為公開且穩定的 API,不應在版本之間修改。" #: ../../library/sys.rst:107 msgid "" From c38ff75cf4950087e9fbb94f69bfa8f8052a403a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 12 Jul 2025 11:16:26 +0000 Subject: [PATCH 3/7] Translate core sys module sections: path, version, exit functions Co-authored-by: josix <18432820+josix@users.noreply.github.com> --- library/sys.po | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/library/sys.po b/library/sys.po index 57ec9ee7a8..e20010ec4b 100644 --- a/library/sys.po +++ b/library/sys.po @@ -625,6 +625,7 @@ msgid "" "Raise a :exc:`SystemExit` exception, signaling an intention to exit the " "interpreter." msgstr "" +"引發 :exc:`SystemExit` 例外,表示意圖退出直譯器。" #: ../../library/sys.rst:504 msgid "" @@ -641,6 +642,7 @@ msgid "" "code of 1. In particular, ``sys.exit(\"some error message\")`` is a quick " "way to exit a program when an error occurs." msgstr "" +"選擇性引數 *arg* 可以是給出退出狀態的整數(預設為零),或其他型別的物件。如果它是整數,零被 shell 等視為「成功終止」,任何非零值被視為「異常終止」。大多數系統要求它在 0-127 範圍內,否則會產生未定義的結果。某些系統有將特定含義分配給特定退出代碼的慣例,但這些通常不太成熟;Unix 程式通常使用 2 來表示命令列語法錯誤,使用 1 來表示所有其他類型的錯誤。如果傳遞了其他型別的物件,``None`` 等同於傳遞零,任何其他物件會被列印到 :data:`stderr` 並導致退出代碼為 1。特別是,``sys.exit(\"some error message\")`` 是在發生錯誤時退出程式的快速方法。" #: ../../library/sys.rst:517 msgid "" @@ -650,6 +652,7 @@ msgid "" "statements are honored, and it is possible to intercept the exit attempt at " "an outer level." msgstr "" +"由於 :func:`exit` 最終「只是」引發例外,它只有在從主執行緒呼叫且例外未被攔截時才會退出程序。:keyword:`try` 陳述式的 finally 子句中指定的清理動作會被執行,並且可以在外層攔截退出嘗試。" #: ../../library/sys.rst:522 msgid "" @@ -1687,6 +1690,7 @@ msgid "" "user's program. Arguments consumed by the interpreter itself will be present " "in :data:`sys.orig_argv` and missing from :data:`sys.argv`." msgstr "" +":data:`sys.orig_argv` 的元素是 Python 直譯器的引數,而 :data:`sys.argv` 的元素是使用者程式的引數。被直譯器本身消耗的引數會出現在 :data:`sys.orig_argv` 中,但在 :data:`sys.argv` 中會缺失。" #: ../../library/sys.rst:1366 msgid "" @@ -1694,6 +1698,7 @@ msgid "" "from the environment variable :envvar:`PYTHONPATH`, plus an installation-" "dependent default." msgstr "" +"指定模組搜尋路徑的字串清單。從環境變數 :envvar:`PYTHONPATH` 初始化,加上依賴安裝的預設值。" #: ../../library/sys.rst:1370 msgid "" @@ -1701,29 +1706,34 @@ msgid "" "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" +"預設情況下,在程式啟動時初始化時,會將一個可能不安全的路徑前置到 :data:`sys.path`(在由於 :envvar:`PYTHONPATH` 而插入的條目*之前*):" #: ../../library/sys.rst:1374 msgid "" "``python -m module`` command line: prepend the current working directory." msgstr "" +"``python -m module`` 命令列:前置目前工作目錄。" #: ../../library/sys.rst:1376 msgid "" "``python script.py`` command line: prepend the script's directory. If it's a " "symbolic link, resolve symbolic links." msgstr "" +"``python script.py`` 命令列:前置指令碼的目錄。如果它是符號連結,則解析符號連結。" #: ../../library/sys.rst:1378 msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" +"``python -c code`` 和 ``python``(REPL)命令列:前置空字串,這表示目前工作目錄。" #: ../../library/sys.rst:1381 msgid "" "To not prepend this potentially unsafe path, use the :option:`-P` command " "line option or the :envvar:`PYTHONSAFEPATH` environment variable." msgstr "" +"為了不前置這個可能不安全的路徑,請使用 :option:`-P` 命令列選項或 :envvar:`PYTHONSAFEPATH` 環境變數。" #: ../../library/sys.rst:1384 msgid "" @@ -1731,12 +1741,14 @@ msgid "" "should be added to :data:`sys.path`; all other data types are ignored during " "import." msgstr "" +"程式可以自由地為自己的目的修改這個清單。只能將字串加入到 :data:`sys.path`;所有其他資料型別在匯入時會被忽略。" #: ../../library/sys.rst:1390 msgid "" "Module :mod:`site` This describes how to use .pth files to extend :data:`sys." "path`." msgstr "" +"模組 :mod:`site` 這描述了如何使用 .pth 檔案來擴展 :data:`sys.path`。" #: ../../library/sys.rst:1395 msgid "" @@ -2630,12 +2642,14 @@ msgid "" "version information out of it, rather, use :data:`version_info` and the " "functions provided by the :mod:`platform` module." msgstr "" +"包含 Python 直譯器版本號碼以及建置號碼和所使用編譯器的額外資訊的字串。這個字串會在啟動互動式直譯器時顯示。不要從中擷取版本資訊,而是應使用 :data:`version_info` 和 :mod:`platform` 模組提供的函式。" #: ../../library/sys.rst:2016 msgid "" "The C API version for this interpreter. Programmers may find this useful " "when debugging version conflicts between Python and extension modules." msgstr "" +"此直譯器的 C API 版本。程式設計師在除錯 Python 和擴充模組之間的版本衝突時可能會發現這很有用。" #: ../../library/sys.rst:2022 msgid "" @@ -2647,6 +2661,7 @@ msgid "" "also be accessed by name, so ``sys.version_info[0]`` is equivalent to ``sys." "version_info.major`` and so on." msgstr "" +"包含版本號碼五個組成部分的元組:*major*、*minor*、*micro*、*releaselevel* 和 *serial*。除了 *releaselevel* 以外的所有值都是整數;發布級別是 ``'alpha'``、``'beta'``、``'candidate'`` 或 ``'final'``。對應於 Python 版本 2.0 的 ``version_info`` 值是 ``(2, 0, 0, 'final', 0)``。這些組成部分也可以透過名稱存取,所以 ``sys.version_info[0]`` 等同於 ``sys.version_info.major``,以此類推。" #: ../../library/sys.rst:2030 msgid "Added named component attributes." From 6d90b2e245d1aea66415c85c7fa31d5ad319c554 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 12 Jul 2025 11:20:31 +0000 Subject: [PATCH 4/7] Complete additional key sys.po translations: modules, stdio streams, recursion limits Co-authored-by: josix <18432820+josix@users.noreply.github.com> --- library/sys.po | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/library/sys.po b/library/sys.po index e20010ec4b..ffdd7876a6 100644 --- a/library/sys.po +++ b/library/sys.po @@ -255,7 +255,7 @@ msgstr "" #: ../../library/sys.rst:187 msgid "A string containing the copyright pertaining to the Python interpreter." -msgstr "" +msgstr "包含與 Python 直譯器相關的版權資訊的字串。" #: ../../library/sys.rst:192 msgid "" @@ -1111,6 +1111,7 @@ msgid "" "causing an overflow of the C stack and crashing Python. It can be set by :" "func:`setrecursionlimit`." msgstr "" +"回傳遞迴限制的目前值,即 Python 直譯器堆疊的最大深度。此限制防止無限遞迴導致 C 堆疊溢位並導致 Python 當機。它可以透過 :func:`setrecursionlimit` 設定。" #: ../../library/sys.rst:865 msgid "" @@ -1676,12 +1677,14 @@ msgid "" "size may change during iteration as a side effect of code or activity in " "other threads." msgstr "" +"這是一個將模組名稱對應到已經載入的模組的字典。這可以被操作來強制重新載入模組和其他技巧。然而,替換字典不一定會如預期般運作,從字典中刪除重要項目可能會導致 Python 失敗。如果你想要迭代這個全域字典,請總是使用 ``sys.modules.copy()`` 或 ``tuple(sys.modules)`` 來避免例外,因為其大小可能會在迭代過程中因為其他執行緒中的程式碼或活動而改變。" #: ../../library/sys.rst:1351 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" +"傳遞給 Python 可執行檔的原始命令列引數清單。" #: ../../library/sys.rst:1354 msgid "" @@ -1771,7 +1774,7 @@ msgstr "" #: ../../library/sys.rst:1415 msgid "A string containing a platform identifier. Known values are:" -msgstr "" +msgstr "包含平台識別符的字串。已知的值有:" #: ../../library/sys.rst:1418 msgid "System" @@ -2073,6 +2076,7 @@ msgid "" "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" +"將 Python 直譯器堆疊的最大深度設定為 *limit*。此限制防止無限遞迴導致 C 堆疊溢位並導致 Python 當機。" #: ../../library/sys.rst:1591 msgid "" @@ -2081,12 +2085,14 @@ msgid "" "platform that supports a higher limit. This should be done with care, " "because a too-high limit can lead to a crash." msgstr "" +"可能的最高限制取決於平台。當使用者有需要深度遞迴的程式且平台支援更高限制時,可能需要設定更高的限制。這應該謹慎進行,因為過高的限制可能導致當機。" #: ../../library/sys.rst:1596 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" +"如果新限制在目前遞迴深度下過低,會引發 :exc:`RecursionError` 例外。" #: ../../library/sys.rst:1599 msgid "" @@ -2368,34 +2374,39 @@ msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" +"直譯器用於標準輸入、輸出和錯誤的\\ :term:`檔案物件 `:" #: ../../library/sys.rst:1824 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" +"``stdin`` 用於所有互動式輸入(包括對 :func:`input` 的呼叫);" #: ../../library/sys.rst:1826 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" +"``stdout`` 用於 :func:`print` 和\\ :term:`運算式 ` 陳述式的輸出以及 :func:`input` 的提示;" #: ../../library/sys.rst:1828 msgid "The interpreter's own prompts and its error messages go to ``stderr``." -msgstr "" +msgstr "直譯器自己的提示和錯誤訊息會輸出到 ``stderr``。" #: ../../library/sys.rst:1830 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" +"這些串流是常規的\\ :term:`文字檔案 `,就像 :func:`open` 函式回傳的那些。它們的參數選擇如下:" #: ../../library/sys.rst:1834 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" +"編碼和錯誤處理從 :c:member:`PyConfig.stdio_encoding` 和 :c:member:`PyConfig.stdio_errors` 初始化。" #: ../../library/sys.rst:1837 msgid "" @@ -2673,6 +2684,7 @@ msgid "" "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" +"這是警告框架的實作細節;不要修改此值。請參考 :mod:`warnings` 模組以獲取有關警告框架的更多資訊。" #: ../../library/sys.rst:2042 msgid "" From b8b7927116b50749949bc689783df87ef639615b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 12 Jul 2025 13:00:58 +0000 Subject: [PATCH 5/7] Fix CI errors: resolve unmatched backticks in sys.po translations Co-authored-by: josix <18432820+josix@users.noreply.github.com> --- library/sys.po | 45 +++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/library/sys.po b/library/sys.po index ffdd7876a6..ab5be3cd7c 100644 --- a/library/sys.po +++ b/library/sys.po @@ -94,10 +94,9 @@ msgid "" "and the exception suppressed. As a result, callers cannot assume that their " "hook has been added unless they control all existing hooks." msgstr "" -"呼叫 :func:`sys.addaudithook` 本身會引發一個不帶任何引數、名為 ``sys." -"addaudithook`` 的稽核事件。如果任何現有的 hook 引發從 :class:`RuntimeError` " -"衍生的例外,則不會添加新的 hook 並抑制異常。因此,除非呼叫者控制所有已存在的 " -"hook,他們不能假設他們的 hook 已被添加。" +"呼叫 :func:`sys.addaudithook` 本身會引發一個不帶任何引數、名為 ``sys.addaudithook`` " +"的稽核事件。如果任何現有的 hook 引發從 :class:`RuntimeError` 衍生的例外,則不會添加新的 hook " +"並抑制異常。因此,除非呼叫者控制所有已存在的 hook,他們不能假設他們的 hook 已被添加。" #: ../../library/sys.rst:58 msgid "" @@ -255,7 +254,7 @@ msgstr "" #: ../../library/sys.rst:187 msgid "A string containing the copyright pertaining to the Python interpreter." -msgstr "包含與 Python 直譯器相關的版權資訊的字串。" +msgstr "" #: ../../library/sys.rst:192 msgid "" @@ -321,8 +320,7 @@ msgid "" "Raises an :ref:`auditing event ` ``sys._current_exceptions`` with " "no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." -"_current_exceptions``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys._current_exceptions``。" #: ../../library/sys.rst:240 msgid "" @@ -470,8 +468,7 @@ msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." msgstr "" -"運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js " -"v14.18.2'`` 或 ``'UNKNOWN'``。" +"運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js v14.18.2'`` 或 ``'UNKNOWN'``。" #: ../../library/sys.rst:363 msgid "``True`` if Python is compiled with Emscripten pthreads support." @@ -1111,7 +1108,6 @@ msgid "" "causing an overflow of the C stack and crashing Python. It can be set by :" "func:`setrecursionlimit`." msgstr "" -"回傳遞迴限制的目前值,即 Python 直譯器堆疊的最大深度。此限制防止無限遞迴導致 C 堆疊溢位並導致 Python 當機。它可以透過 :func:`setrecursionlimit` 設定。" #: ../../library/sys.rst:865 msgid "" @@ -1167,8 +1163,7 @@ msgid "" "Raises an :ref:`auditing event ` ``sys._getframe`` with argument " "``frame``." msgstr "" -"引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys." -"_getframe``。" +"引發一個附帶引數 ``frame`` 的\\ :ref:`稽核事件 ` ``sys._getframe``。" #: ../../library/sys.rst:903 ../../library/sys.rst:919 msgid "" @@ -1190,8 +1185,7 @@ msgid "" "Raises an :ref:`auditing event ` ``sys._getframemodulename`` with " "argument ``depth``." msgstr "" -"引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys." -"_getframemodulename``。" +"引發一個附帶引數 ``depth`` 的\\ :ref:`稽核事件 ` ``sys._getframemodulename``。" #: ../../library/sys.rst:927 msgid "" @@ -1677,14 +1671,12 @@ msgid "" "size may change during iteration as a side effect of code or activity in " "other threads." msgstr "" -"這是一個將模組名稱對應到已經載入的模組的字典。這可以被操作來強制重新載入模組和其他技巧。然而,替換字典不一定會如預期般運作,從字典中刪除重要項目可能會導致 Python 失敗。如果你想要迭代這個全域字典,請總是使用 ``sys.modules.copy()`` 或 ``tuple(sys.modules)`` 來避免例外,因為其大小可能會在迭代過程中因為其他執行緒中的程式碼或活動而改變。" #: ../../library/sys.rst:1351 msgid "" "The list of the original command line arguments passed to the Python " "executable." msgstr "" -"傳遞給 Python 可執行檔的原始命令列引數清單。" #: ../../library/sys.rst:1354 msgid "" @@ -1709,7 +1701,7 @@ msgid "" "is prepended to :data:`sys.path` (*before* the entries inserted as a result " "of :envvar:`PYTHONPATH`):" msgstr "" -"預設情況下,在程式啟動時初始化時,會將一個可能不安全的路徑前置到 :data:`sys.path`(在由於 :envvar:`PYTHONPATH` 而插入的條目*之前*):" +"預設情況下,在程式啟動時初始化時,會將一個可能不安全的路徑前置到 :data:`sys.path` (在 :envvar:`PYTHONPATH` 產生的條目之前):" #: ../../library/sys.rst:1374 msgid "" @@ -1774,7 +1766,7 @@ msgstr "" #: ../../library/sys.rst:1415 msgid "A string containing a platform identifier. Known values are:" -msgstr "包含平台識別符的字串。已知的值有:" +msgstr "" #: ../../library/sys.rst:1418 msgid "System" @@ -2076,7 +2068,6 @@ msgid "" "limit prevents infinite recursion from causing an overflow of the C stack " "and crashing Python." msgstr "" -"將 Python 直譯器堆疊的最大深度設定為 *limit*。此限制防止無限遞迴導致 C 堆疊溢位並導致 Python 當機。" #: ../../library/sys.rst:1591 msgid "" @@ -2085,14 +2076,12 @@ msgid "" "platform that supports a higher limit. This should be done with care, " "because a too-high limit can lead to a crash." msgstr "" -"可能的最高限制取決於平台。當使用者有需要深度遞迴的程式且平台支援更高限制時,可能需要設定更高的限制。這應該謹慎進行,因為過高的限制可能導致當機。" #: ../../library/sys.rst:1596 msgid "" "If the new limit is too low at the current recursion depth, a :exc:" "`RecursionError` exception is raised." msgstr "" -"如果新限制在目前遞迴深度下過低,會引發 :exc:`RecursionError` 例外。" #: ../../library/sys.rst:1599 msgid "" @@ -2266,16 +2255,14 @@ msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_firstiter`` with no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." -"set_asyncgen_hooks_firstiter``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.set_asyncgen_hooks_firstiter``。" #: ../../library/sys.rst:1724 msgid "" "Raises an :ref:`auditing event ` ``sys." "set_asyncgen_hooks_finalizer`` with no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys." -"set_asyncgen_hooks_finalizer``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``sys.set_asyncgen_hooks_finalizer``。" #: ../../library/sys.rst:1726 msgid "" @@ -2374,39 +2361,34 @@ msgid "" ":term:`File objects ` used by the interpreter for standard " "input, output and errors:" msgstr "" -"直譯器用於標準輸入、輸出和錯誤的\\ :term:`檔案物件 `:" #: ../../library/sys.rst:1824 msgid "" "``stdin`` is used for all interactive input (including calls to :func:" "`input`);" msgstr "" -"``stdin`` 用於所有互動式輸入(包括對 :func:`input` 的呼叫);" #: ../../library/sys.rst:1826 msgid "" "``stdout`` is used for the output of :func:`print` and :term:`expression` " "statements and for the prompts of :func:`input`;" msgstr "" -"``stdout`` 用於 :func:`print` 和\\ :term:`運算式 ` 陳述式的輸出以及 :func:`input` 的提示;" #: ../../library/sys.rst:1828 msgid "The interpreter's own prompts and its error messages go to ``stderr``." -msgstr "直譯器自己的提示和錯誤訊息會輸出到 ``stderr``。" +msgstr "" #: ../../library/sys.rst:1830 msgid "" "These streams are regular :term:`text files ` like those returned " "by the :func:`open` function. Their parameters are chosen as follows:" msgstr "" -"這些串流是常規的\\ :term:`文字檔案 `,就像 :func:`open` 函式回傳的那些。它們的參數選擇如下:" #: ../../library/sys.rst:1834 msgid "" "The encoding and error handling are is initialized from :c:member:`PyConfig." "stdio_encoding` and :c:member:`PyConfig.stdio_errors`." msgstr "" -"編碼和錯誤處理從 :c:member:`PyConfig.stdio_encoding` 和 :c:member:`PyConfig.stdio_errors` 初始化。" #: ../../library/sys.rst:1837 msgid "" @@ -2684,7 +2666,6 @@ msgid "" "this value. Refer to the :mod:`warnings` module for more information on the " "warnings framework." msgstr "" -"這是警告框架的實作細節;不要修改此值。請參考 :mod:`warnings` 模組以獲取有關警告框架的更多資訊。" #: ../../library/sys.rst:2042 msgid "" From dcee81e62bb36942d66b02714f16cad8b9af632f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 12 Jul 2025 13:57:17 +0000 Subject: [PATCH 6/7] Fix translation consistency issues: brackets, terminology, and formatting Co-authored-by: josix <18432820+josix@users.noreply.github.com> --- library/sys.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/sys.po b/library/sys.po index ab5be3cd7c..801e5f4580 100644 --- a/library/sys.po +++ b/library/sys.po @@ -96,7 +96,7 @@ msgid "" msgstr "" "呼叫 :func:`sys.addaudithook` 本身會引發一個不帶任何引數、名為 ``sys.addaudithook`` " "的稽核事件。如果任何現有的 hook 引發從 :class:`RuntimeError` 衍生的例外,則不會添加新的 hook " -"並抑制異常。因此,除非呼叫者控制所有已存在的 hook,他們不能假設他們的 hook 已被添加。" +"並抑制例外。因此,除非呼叫者控制所有已存在的 hook,他們不能假設他們的 hook 已被添加。" #: ../../library/sys.rst:58 msgid "" @@ -468,7 +468,7 @@ msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." msgstr "" -"運行環境字串,例如瀏覽器使用者代理 (browser user agent) ``'Node.js v14.18.2'`` 或 ``'UNKNOWN'``。" +"運行環境字串,例如瀏覽器使用者代理(browser user agent)``'Node.js v14.18.2'`` 或 ``'UNKNOWN'``。" #: ../../library/sys.rst:363 msgid "``True`` if Python is compiled with Emscripten pthreads support." @@ -639,7 +639,7 @@ msgid "" "code of 1. In particular, ``sys.exit(\"some error message\")`` is a quick " "way to exit a program when an error occurs." msgstr "" -"選擇性引數 *arg* 可以是給出退出狀態的整數(預設為零),或其他型別的物件。如果它是整數,零被 shell 等視為「成功終止」,任何非零值被視為「異常終止」。大多數系統要求它在 0-127 範圍內,否則會產生未定義的結果。某些系統有將特定含義分配給特定退出代碼的慣例,但這些通常不太成熟;Unix 程式通常使用 2 來表示命令列語法錯誤,使用 1 來表示所有其他類型的錯誤。如果傳遞了其他型別的物件,``None`` 等同於傳遞零,任何其他物件會被列印到 :data:`stderr` 並導致退出代碼為 1。特別是,``sys.exit(\"some error message\")`` 是在發生錯誤時退出程式的快速方法。" +"選擇性引數 *arg* 可以是給出退出狀態的整數(預設為零),或其他型別的物件。如果它是整數,零被 shell 等視為「成功終止」,任何非零值被視為「異常終止」。大多數系統要求它在 0-127 範圍內,否則會產生未定義的結果。某些系統有將特定含義分配給特定退出代碼的慣例,但這些通常不太成熟;Unix 程式通常使用 2 來表示命令列語法錯誤,使用 1 來表示所有其他類型的錯誤。如果傳遞了其他型別的物件,``None`` 等同於傳遞零,任何其他物件會被列印到 :data:`stderr` 並導致退出代碼為 1。特別是,``sys.exit("some error message")`` 是在發生錯誤時退出程式的快速方法。" #: ../../library/sys.rst:517 msgid "" From e0ffd047bb7fad67689ae3a70877e18fb0da4a01 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 13 Jul 2025 14:17:14 +0000 Subject: [PATCH 7/7] Fix CI errors: resolve inline literal formatting issues in sys.po Co-authored-by: josix <18432820+josix@users.noreply.github.com> --- library/sys.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/sys.po b/library/sys.po index 801e5f4580..b5b0d398a2 100644 --- a/library/sys.po +++ b/library/sys.po @@ -468,7 +468,7 @@ msgid "" "Runtime string, e.g. browser user agent, ``'Node.js v14.18.2'``, or " "``'UNKNOWN'``." msgstr "" -"運行環境字串,例如瀏覽器使用者代理(browser user agent)``'Node.js v14.18.2'`` 或 ``'UNKNOWN'``。" +"運行環境字串,例如瀏覽器使用者代理(browser user agent) ``'Node.js v14.18.2'`` 或 ``'UNKNOWN'``。" #: ../../library/sys.rst:363 msgid "``True`` if Python is compiled with Emscripten pthreads support." @@ -639,7 +639,7 @@ msgid "" "code of 1. In particular, ``sys.exit(\"some error message\")`` is a quick " "way to exit a program when an error occurs." msgstr "" -"選擇性引數 *arg* 可以是給出退出狀態的整數(預設為零),或其他型別的物件。如果它是整數,零被 shell 等視為「成功終止」,任何非零值被視為「異常終止」。大多數系統要求它在 0-127 範圍內,否則會產生未定義的結果。某些系統有將特定含義分配給特定退出代碼的慣例,但這些通常不太成熟;Unix 程式通常使用 2 來表示命令列語法錯誤,使用 1 來表示所有其他類型的錯誤。如果傳遞了其他型別的物件,``None`` 等同於傳遞零,任何其他物件會被列印到 :data:`stderr` 並導致退出代碼為 1。特別是,``sys.exit("some error message")`` 是在發生錯誤時退出程式的快速方法。" +"選擇性引數 *arg* 可以是給出退出狀態的整數(預設為零),或其他型別的物件。如果它是整數,零被 shell 等視為「成功終止」,任何非零值被視為「異常終止」。大多數系統要求它在 0-127 範圍內,否則會產生未定義的結果。某些系統有將特定含義分配給特定退出代碼的慣例,但這些通常不太成熟;Unix 程式通常使用 2 來表示命令列語法錯誤,使用 1 來表示所有其他類型的錯誤。如果傳遞了其他型別的物件,``None`` 等同於傳遞零,任何其他物件會被列印到 :data:`stderr` 並導致退出代碼為 1。特別是,``sys.exit(\"some error message\")`` 是在發生錯誤時退出程式的快速方法。" #: ../../library/sys.rst:517 msgid "" @@ -1721,7 +1721,7 @@ msgid "" "``python -c code`` and ``python`` (REPL) command lines: prepend an empty " "string, which means the current working directory." msgstr "" -"``python -c code`` 和 ``python``(REPL)命令列:前置空字串,這表示目前工作目錄。" +"``python -c code`` 和 ``python`` (REPL)命令列:前置空字串,這表示目前工作目錄。" #: ../../library/sys.rst:1381 msgid ""