@@ -30,18 +30,21 @@ msgid ""
30
30
"is always available. Unless explicitly noted otherwise, all variables are "
31
31
"read-only."
32
32
msgstr ""
33
+ "此模組提供存取一些由直譯器使用或維護的變數,以及與直譯器強烈互動的函式。它總是可用的。除非明確說明,否則所有變數都是唯讀的。"
33
34
34
35
#: ../../library/sys.rst:16
35
36
msgid ""
36
37
"On POSIX systems where Python was built with the standard ``configure`` "
37
38
"script, this contains the ABI flags as specified by :pep:`3149`."
38
39
msgstr ""
40
+ "在使用標準 ``configure`` 指令碼建置 Python 的 POSIX 系統上,這包含 :pep:`3149` 中規定的 ABI 旗標。"
39
41
40
42
#: ../../library/sys.rst:21
41
43
msgid ""
42
44
"Default flags became an empty string (``m`` flag for pymalloc has been "
43
45
"removed)."
44
46
msgstr ""
47
+ "預設旗標變成空字串(pymalloc 的 ``m`` 旗標已被移除)。"
45
48
46
49
#: ../../library/sys.rst:25 ../../library/sys.rst:299 ../../library/sys.rst:369
47
50
#: ../../library/sys.rst:760 ../../library/sys.rst:778
@@ -57,6 +60,7 @@ msgid ""
57
60
"Append the callable *hook* to the list of active auditing hooks for the "
58
61
"current (sub)interpreter."
59
62
msgstr ""
63
+ "將可呼叫的 *hook* 附加到目前(子)直譯器的活躍稽核 hook 清單中。"
60
64
61
65
#: ../../library/sys.rst:33
62
66
msgid ""
@@ -67,6 +71,7 @@ msgid ""
67
71
"Hooks can then log the event, raise an exception to abort the operation, or "
68
72
"terminate the process entirely."
69
73
msgstr ""
74
+ "當稽核事件透過 :func:`sys.audit` 函式引發時,每個 hook 都會按照其新增的順序被呼叫,並傳入事件名稱和引數元組。由 :c:func:`PySys_AddAuditHook` 新增的原生 hook 會先被呼叫,接著是在目前(子)直譯器中新增的 hook。Hook 可以記錄事件、引發例外以中止操作,或完全終止程序。"
70
75
71
76
#: ../../library/sys.rst:40
72
77
msgid ""
@@ -79,6 +84,7 @@ msgid ""
79
84
"runtime, and any modules allowing arbitrary memory modification (such as :"
80
85
"mod:`ctypes`) should be completely removed or closely monitored."
81
86
msgstr ""
87
+ "請注意稽核 hook 主要是用來收集關於內部或其他無法觀察的操作的資訊,無論是由 Python 或以 Python 撰寫的函式庫執行的。它們不適合用來實作「沙盒」。特別是,惡意程式碼可以輕易地停用或繞過使用此函式新增的 hook。至少,任何安全敏感的 hook 必須在初始化執行時期之前使用 C API :c:func:`PySys_AddAuditHook` 新增,而任何允許任意記憶體修改的模組(例如 :mod:`ctypes`)應該被完全移除或密切監控。"
82
88
83
89
#: ../../library/sys.rst:49 ../../library/sys.rst:51
84
90
msgid ""
@@ -106,13 +112,15 @@ msgid ""
106
112
"Exceptions derived from :class:`Exception` but not :class:`RuntimeError` are "
107
113
"no longer suppressed."
108
114
msgstr ""
115
+ "衍生自 :class:`Exception` 但非 :class:`RuntimeError` 的例外不再被抑制。"
109
116
110
117
#: ../../library/sys.rst:70
111
118
msgid ""
112
119
"When tracing is enabled (see :func:`settrace`), Python hooks are only traced "
113
120
"if the callable has a ``__cantrace__`` member that is set to a true value. "
114
121
"Otherwise, trace functions will skip the hook."
115
122
msgstr ""
123
+ "當追蹤功能啟用時(參閱 :func:`settrace`),Python hook 只有在可呼叫物件具有設定為真值的 ``__cantrace__`` 成員時才會被追蹤。否則,追蹤函式會跳過該 hook。"
116
124
117
125
#: ../../library/sys.rst:77
118
126
msgid ""
@@ -123,6 +131,7 @@ msgid ""
123
131
"c'``. If no script name was passed to the Python interpreter, ``argv[0]`` "
124
132
"is the empty string."
125
133
msgstr ""
134
+ "傳遞給 Python 指令碼的命令列引數清單。``argv[0]`` 是指令碼名稱(這是否為完整路徑取決於作業系統)。如果命令是使用直譯器的 :option:`-c` 命令列選項執行的,``argv[0]`` 會被設定為字串 ``'-c'``。如果沒有將指令碼名稱傳遞給 Python 直譯器,``argv[0]`` 是空字串。"
126
135
127
136
#: ../../library/sys.rst:83
128
137
msgid ""
@@ -141,6 +150,7 @@ msgid ""
141
150
"you need original bytes, you can get it by ``[os.fsencode(arg) for arg in "
142
151
"sys.argv]``."
143
152
msgstr ""
153
+ "在 Unix 上,命令列引數會以位元組形式從作業系統傳遞。Python 使用檔案系統編碼和 \" surrogateescape\" 錯誤處理器來解碼它們。當你需要原始位元組時,可以透過 ``[os.fsencode(arg) for arg in sys.argv]`` 來取得。"
144
154
145
155
#: ../../library/sys.rst:101
146
156
msgid ""
@@ -150,6 +160,7 @@ msgid ""
150
160
"given event are considered a public and stable API and should not be "
151
161
"modified between releases."
152
162
msgstr ""
163
+ "引發一個稽核事件並觸發任何活躍的稽核 hook。*event* 是識別事件的字串,*args* 可能包含關於該事件更多資訊的選擇性引數。給定事件的引數數量和型別被視為公開且穩定的 API,不應在版本之間修改。"
153
164
154
165
#: ../../library/sys.rst:107
155
166
msgid ""
0 commit comments