1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2022, Python Software Foundation
1
+ # Copyright (C) 2001-2024, Python Software Foundation
3
2
# This file is distributed under the same license as the Python package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
3
#
4
+ # Translators:
5
+ # Matt Wang <[email protected] >, 2024
6
6
#, fuzzy
7
7
msgid ""
8
8
msgstr ""
9
9
"Project-Id-Version : Python 3.12\n "
10
10
"Report-Msgid-Bugs-To : \n "
11
11
"POT-Creation-Date : 2023-10-11 17:13+0000\n "
12
- "PO-Revision-Date : YEAR-MO-DA HO:MI+ZONE \n "
13
- "Last-Translator : FULL NAME <EMAIL@ADDRESS >\n "
12
+ "PO-Revision-Date : 2024-05-03 02:14+0800 \n "
13
+ "
Last-Translator :
Matt Wang <[email protected] >\n"
14
14
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
15
15
"tw)\n "
16
16
"Language : zh_TW\n "
@@ -20,7 +20,7 @@ msgstr ""
20
20
21
21
#: ../../library/devmode.rst:4
22
22
msgid "Python Development Mode"
23
- msgstr ""
23
+ msgstr "Python 開發模式 "
24
24
25
25
#: ../../library/devmode.rst:8
26
26
msgid ""
@@ -29,36 +29,42 @@ msgid ""
29
29
"the default if the code is correct; new warnings are only emitted when an "
30
30
"issue is detected."
31
31
msgstr ""
32
+ "Python 開發模式引入了額外的 runtime 檢查,預設啟用這些檢查的成本太高。如果程"
33
+ "式碼正確,它不應比預設值更詳細;僅當偵測到問題時才會發出新警告。"
32
34
33
35
#: ../../library/devmode.rst:13
34
36
msgid ""
35
37
"It can be enabled using the :option:`-X dev <-X>` command line option or by "
36
38
"setting the :envvar:`PYTHONDEVMODE` environment variable to ``1``."
37
39
msgstr ""
40
+ "可以使用 :option:`-X dev <-X>` 命令列選項或將 :envvar:`PYTHONDEVMODE` 環境變"
41
+ "數設為 1 來啟用它。"
38
42
39
43
#: ../../library/devmode.rst:16
40
44
msgid "See also :ref:`Python debug build <debug-build>`."
41
- msgstr ""
45
+ msgstr "另請參閱 :ref:`Python 除錯建置 <debug-build>`。 "
42
46
43
47
#: ../../library/devmode.rst:19
44
48
msgid "Effects of the Python Development Mode"
45
- msgstr ""
49
+ msgstr "Python 開發模式的影響 "
46
50
47
51
#: ../../library/devmode.rst:21
48
52
msgid ""
49
53
"Enabling the Python Development Mode is similar to the following command, "
50
54
"but with additional effects described below::"
51
- msgstr ""
55
+ msgstr "啟用 Python 開發模式類似以下指令,但具有如下所述的附加效果: "
52
56
53
57
#: ../../library/devmode.rst:26
54
58
msgid "Effects of the Python Development Mode:"
55
- msgstr ""
59
+ msgstr "Python 開發模式的效果: "
56
60
57
61
#: ../../library/devmode.rst:28
58
62
msgid ""
59
63
"Add ``default`` :ref:`warning filter <describing-warning-filters>`. The "
60
64
"following warnings are shown:"
61
65
msgstr ""
66
+ "新增 ``default`` :ref:`警告過濾器 <describing-warning-filters>`。以下警告會被"
67
+ "顯示:"
62
68
63
69
#: ../../library/devmode.rst:31
64
70
msgid ":exc:`DeprecationWarning`"
@@ -81,55 +87,61 @@ msgid ""
81
87
"Normally, the above warnings are filtered by the default :ref:`warning "
82
88
"filters <describing-warning-filters>`."
83
89
msgstr ""
90
+ "一般來說,上述警告會被預設的\\ :ref:`警告過濾器 <describing-warning-"
91
+ "filters>`\\ 給過濾掉。"
84
92
85
93
#: ../../library/devmode.rst:39
86
94
msgid ""
87
95
"It behaves as if the :option:`-W default <-W>` command line option is used."
88
- msgstr ""
96
+ msgstr "它的行為就像使用 :option:`-W default <-W>` 命令列選項一樣。 "
89
97
90
98
#: ../../library/devmode.rst:41
91
99
msgid ""
92
100
"Use the :option:`-W error <-W>` command line option or set the :envvar:"
93
101
"`PYTHONWARNINGS` environment variable to ``error`` to treat warnings as "
94
102
"errors."
95
103
msgstr ""
104
+ "使用 :option:`-W error <-W>` 命令列選項或將 :envvar:`PYTHONWARNINGS` 環境變數"
105
+ "設為 ``error`` 會將警告視為錯誤。"
96
106
97
107
#: ../../library/devmode.rst:45
98
108
msgid "Install debug hooks on memory allocators to check for:"
99
- msgstr ""
109
+ msgstr "在記憶體分配器上安裝除錯 hook(掛鉤)以檢查: "
100
110
101
111
#: ../../library/devmode.rst:47
102
112
msgid "Buffer underflow"
103
- msgstr ""
113
+ msgstr "緩衝區下溢 (underflow) "
104
114
105
115
#: ../../library/devmode.rst:48
106
116
msgid "Buffer overflow"
107
- msgstr ""
117
+ msgstr "緩衝區溢位 (overflow) "
108
118
109
119
#: ../../library/devmode.rst:49
110
120
msgid "Memory allocator API violation"
111
- msgstr ""
121
+ msgstr "記憶體分配器 API 違規 "
112
122
113
123
#: ../../library/devmode.rst:50
114
124
msgid "Unsafe usage of the GIL"
115
- msgstr ""
125
+ msgstr "GIL 的不安全使用 "
116
126
117
127
#: ../../library/devmode.rst:52
118
128
msgid "See the :c:func:`PyMem_SetupDebugHooks` C function."
119
- msgstr ""
129
+ msgstr "請參閱 :c:func:`PyMem_SetupDebugHooks` C 函式。 "
120
130
121
131
#: ../../library/devmode.rst:54
122
132
msgid ""
123
133
"It behaves as if the :envvar:`PYTHONMALLOC` environment variable is set to "
124
134
"``debug``."
125
- msgstr ""
135
+ msgstr "它的行為就好像是將 :envvar:`PYTHONMALLOC` 環境變數設定為 ``debug``。 "
126
136
127
137
#: ../../library/devmode.rst:57
128
138
msgid ""
129
139
"To enable the Python Development Mode without installing debug hooks on "
130
140
"memory allocators, set the :envvar:`PYTHONMALLOC` environment variable to "
131
141
"``default``."
132
142
msgstr ""
143
+ "若要啟用 Python 開發模式而不在記憶體分配器上安裝偵錯 hook,請將 :envvar:"
144
+ "`PYTHONMALLOC` 環境變數設為 ``default``。"
133
145
134
146
#: ../../library/devmode.rst:61
135
147
msgid ""
@@ -138,49 +150,62 @@ msgid ""
138
150
"SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to "
139
151
"dump the Python traceback on a crash."
140
152
msgstr ""
153
+ "在 Python 啟動時呼叫 :func:`faulthandler.enable` 來為 :const:`~signal."
154
+ "SIGSEGV`、:const:`~signal.SIGFPE`、:const:`~signal.SIGABRT`、:const:`~signal."
155
+ "SIGBUS` 和 :const:`~signal.SIGILL` 訊號安裝處理函式以在當機時傾印 (dump) "
156
+ "Python 回溯 (traceback)。"
141
157
142
158
#: ../../library/devmode.rst:66
143
159
msgid ""
144
160
"It behaves as if the :option:`-X faulthandler <-X>` command line option is "
145
161
"used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to "
146
162
"``1``."
147
163
msgstr ""
164
+ "它的行為就像使用 :option:`-X faulthandler <-X>` 命令列選項或將 :envvar:"
165
+ "`PYTHONFAULTHANDLER` 環境變數設定為 ``1``。"
148
166
149
167
#: ../../library/devmode.rst:70
150
168
msgid ""
151
169
"Enable :ref:`asyncio debug mode <asyncio-debug-mode>`. For example, :mod:"
152
170
"`asyncio` checks for coroutines that were not awaited and logs them."
153
171
msgstr ""
172
+ "啟用 :ref:`asyncio 除錯模式 <asyncio-debug-mode>`。例如 :mod:`asyncio` 會檢查"
173
+ "未被等待的 (not awaited) 協程並記錄 (log) 它們。"
154
174
155
175
#: ../../library/devmode.rst:73
156
176
msgid ""
157
177
"It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is "
158
178
"set to ``1``."
159
- msgstr ""
179
+ msgstr "它的行為就像將 :envvar:`PYTHONASYNCIODEBUG` 環境變數設定為 1 一樣。 "
160
180
161
181
#: ../../library/devmode.rst:76
162
182
msgid ""
163
183
"Check the *encoding* and *errors* arguments for string encoding and decoding "
164
184
"operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes."
165
185
"decode`."
166
186
msgstr ""
187
+ "檢查字串編碼和解碼操作的 *encoding* 和 *errors* 引數。範例::func:`open`、:"
188
+ "meth:`str.encode` 和 :meth:`bytes.decode`。"
167
189
168
190
#: ../../library/devmode.rst:80
169
191
msgid ""
170
192
"By default, for best performance, the *errors* argument is only checked at "
171
193
"the first encoding/decoding error and the *encoding* argument is sometimes "
172
194
"ignored for empty strings."
173
195
msgstr ""
196
+ "預設情況下,為了獲得最佳效能,僅在第一個編碼/解碼錯誤時檢查 *errors* 引數,並"
197
+ "且有時會因為是空字串而忽略 *encoding* 引數。"
174
198
175
199
#: ../../library/devmode.rst:84
176
200
msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions."
177
- msgstr ""
201
+ msgstr ":class:`io.IOBase` 解構函式會記錄 ``close()`` 例外。 "
178
202
179
203
#: ../../library/devmode.rst:85
180
204
msgid ""
181
205
"Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to "
182
206
"``True``."
183
207
msgstr ""
208
+ "將 :data:`sys.flags` 的 :attr:`~sys.flags.dev_mode` 屬性設為 ``True``。"
184
209
185
210
#: ../../library/devmode.rst:88
186
211
msgid ""
@@ -192,29 +217,37 @@ msgid ""
192
217
"buffer overflow error logs the traceback where the memory block was "
193
218
"allocated."
194
219
msgstr ""
220
+ "Python 開發模式預設不會啟用 :mod:`tracemalloc` 模組,因為(效能和記憶體的)開"
221
+ "銷太大。啟用 :mod:`tracemalloc` 模組可提供有關某些錯誤來源的附加資訊。例如 :"
222
+ "exc:`ResourceWarning` 記錄了分配資源之處的回溯、緩衝區溢位錯誤記錄了分配記憶"
223
+ "體區塊的回溯。"
195
224
196
225
#: ../../library/devmode.rst:95
197
226
msgid ""
198
227
"The Python Development Mode does not prevent the :option:`-O` command line "
199
228
"option from removing :keyword:`assert` statements nor from setting :const:"
200
229
"`__debug__` to ``False``."
201
230
msgstr ""
231
+ "Python 開發模式不會防止 :option:`-O` 命令列選項刪除 :keyword:`assert` 陳述"
232
+ "式,也不會防止將 :const:`__debug__` 設定為 ``False``。"
202
233
203
234
#: ../../library/devmode.rst:99
204
235
msgid ""
205
236
"The Python Development Mode can only be enabled at the Python startup. Its "
206
237
"value can be read from :data:`sys.flags.dev_mode <sys.flags>`."
207
238
msgstr ""
239
+ "Python 開發模式只能在 Python 啟動時啟用。它的值可以從 :data:`sys.flags."
240
+ "dev_mode <sys.flags>` 讀取。"
208
241
209
242
#: ../../library/devmode.rst:102
210
243
msgid "The :class:`io.IOBase` destructor now logs ``close()`` exceptions."
211
- msgstr ""
244
+ msgstr ":class:`io.IOBase` 解構函式現在會記錄 ``close()`` 例外。 "
212
245
213
246
#: ../../library/devmode.rst:105
214
247
msgid ""
215
248
"The *encoding* and *errors* arguments are now checked for string encoding "
216
249
"and decoding operations."
217
- msgstr ""
250
+ msgstr "現在會為字串編碼和解碼操作檢查 *encoding* 和 *errors* 引數。 "
218
251
219
252
#: ../../library/devmode.rst:111
220
253
msgid "ResourceWarning Example"
@@ -224,30 +257,32 @@ msgstr "ResourceWarning 範例"
224
257
msgid ""
225
258
"Example of a script counting the number of lines of the text file specified "
226
259
"in the command line::"
227
- msgstr ""
260
+ msgstr "計算命令列中指定的文字檔案列數的腳本範例: :: "
228
261
229
262
#: ../../library/devmode.rst:127
230
263
msgid ""
231
264
"The script does not close the file explicitly. By default, Python does not "
232
265
"emit any warning. Example using README.txt, which has 269 lines:"
233
266
msgstr ""
267
+ "該腳本不會明確關閉檔案。預設情況下,Python 不會發出任何警告。使用 README.txt "
268
+ "的範例,該檔案有 269 列:"
234
269
235
270
#: ../../library/devmode.rst:135
236
271
msgid ""
237
272
"Enabling the Python Development Mode displays a :exc:`ResourceWarning` "
238
273
"warning:"
239
- msgstr ""
274
+ msgstr "啟用 Python 開發模式會顯示 :exc:`ResourceWarning` 警告: "
240
275
241
276
#: ../../library/devmode.rst:145
242
277
msgid ""
243
278
"In addition, enabling :mod:`tracemalloc` shows the line where the file was "
244
279
"opened:"
245
- msgstr ""
280
+ msgstr "此外,啟用 :mod:`tracemalloc` 會顯示檔案被開啟的那一列: "
246
281
247
282
#: ../../library/devmode.rst:160
248
283
msgid ""
249
284
"The fix is to close explicitly the file. Example using a context manager::"
250
- msgstr ""
285
+ msgstr "修復方法是明確關閉該檔案。使用情境管理器的範例: :: "
251
286
252
287
#: ../../library/devmode.rst:168
253
288
msgid ""
@@ -256,24 +291,29 @@ msgid ""
256
291
"CPython, but it is even worse in PyPy. Closing resources explicitly makes an "
257
292
"application more deterministic and more reliable."
258
293
msgstr ""
294
+ "不明確關閉資源可能會使資源開啟的時間比預期的長得多;它可能會在退出 Python 時"
295
+ "導致嚴重問題。在 CPython 中很糟糕,但在 PyPy 中更糟。明確關閉資源使應用程式更"
296
+ "具確定性和可靠性。"
259
297
260
298
#: ../../library/devmode.rst:175
261
299
msgid "Bad file descriptor error example"
262
- msgstr ""
300
+ msgstr "檔案描述器的錯誤範例 "
263
301
264
302
#: ../../library/devmode.rst:177
265
303
msgid "Script displaying the first line of itself::"
266
- msgstr ""
304
+ msgstr "顯示自身第一行的腳本: :: "
267
305
268
306
#: ../../library/devmode.rst:190
269
307
msgid "By default, Python does not emit any warning:"
270
- msgstr ""
308
+ msgstr "預設情況下,Python 不會發出任何警告: "
271
309
272
310
#: ../../library/devmode.rst:197
273
311
msgid ""
274
312
"The Python Development Mode shows a :exc:`ResourceWarning` and logs a \" Bad "
275
313
"file descriptor\" error when finalizing the file object:"
276
314
msgstr ""
315
+ "Python 開發模式在最終化 (finalize) 檔案物件時顯示 :exc:`ResourceWarning` 並記"
316
+ "錄 \" Bad file descriptor\" 錯誤:"
277
317
278
318
#: ../../library/devmode.rst:213
279
319
msgid ""
@@ -283,9 +323,15 @@ msgid ""
283
323
"worst case scenario, closing it twice can lead to a crash (see :issue:"
284
324
"`18748` for an example)."
285
325
msgstr ""
326
+ "``os.close(fp.fileno())`` 會關閉檔案描述器。當檔案物件最終化器 (finalizer) 嘗"
327
+ "試再次關閉檔案描述器時,它會失敗並出現 ``Bad file descriptor`` 錯誤。檔案描述"
328
+ "器只能關閉一次。在最壞的情況下,將它關閉兩次可能會導致崩潰 (crash)(相關範例"
329
+ "請參閱 :issue:`18748`)。"
286
330
287
331
#: ../../library/devmode.rst:219
288
332
msgid ""
289
333
"The fix is to remove the ``os.close(fp.fileno())`` line, or open the file "
290
334
"with ``closefd=False``."
291
335
msgstr ""
336
+ "修復方法是刪除 ``os.close(fp.fileno())`` 那列,或使用 ``closefd=False`` 開啟"
337
+ "檔案。"
0 commit comments