Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 683f7d8

Browse files
committed
Translate library/devmode.po
1 parent 2501ea7 commit 683f7d8

File tree

1 file changed

+75
-29
lines changed

1 file changed

+75
-29
lines changed

library/devmode.po

Lines changed: 75 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# SOME DESCRIPTIVE TITLE.
2-
# Copyright (C) 2001-2022, Python Software Foundation
1+
# Copyright (C) 2001-2024, Python Software Foundation
32
# This file is distributed under the same license as the Python package.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
53
#
4+
# Translators:
5+
# Matt Wang <[email protected]>, 2024
66
#, fuzzy
77
msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.12\n"
1010
"Report-Msgid-Bugs-To: \n"
1111
"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"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1515
"tw)\n"
1616
"Language: zh_TW\n"
@@ -20,7 +20,7 @@ msgstr ""
2020

2121
#: ../../library/devmode.rst:4
2222
msgid "Python Development Mode"
23-
msgstr ""
23+
msgstr "Python 開發模式"
2424

2525
#: ../../library/devmode.rst:8
2626
msgid ""
@@ -29,36 +29,42 @@ msgid ""
2929
"the default if the code is correct; new warnings are only emitted when an "
3030
"issue is detected."
3131
msgstr ""
32+
"Python 開發模式引入了額外的 runtime 檢查,預設啟用這些檢查的成本太高。如果程"
33+
"式碼正確,它不應比預設值更詳細;僅當偵測到問題時才會發出新警告。"
3234

3335
#: ../../library/devmode.rst:13
3436
msgid ""
3537
"It can be enabled using the :option:`-X dev <-X>` command line option or by "
3638
"setting the :envvar:`PYTHONDEVMODE` environment variable to ``1``."
3739
msgstr ""
40+
"可以使用 :option:`-X dev <-X>` 命令列選項或將 :envvar:`PYTHONDEVMODE` 環境變"
41+
"數設為 1 來啟用它。"
3842

3943
#: ../../library/devmode.rst:16
4044
msgid "See also :ref:`Python debug build <debug-build>`."
41-
msgstr ""
45+
msgstr "另請參閱 :ref:`Python 除錯建置 <debug-build>`。"
4246

4347
#: ../../library/devmode.rst:19
4448
msgid "Effects of the Python Development Mode"
45-
msgstr ""
49+
msgstr "Python 開發模式的影響"
4650

4751
#: ../../library/devmode.rst:21
4852
msgid ""
4953
"Enabling the Python Development Mode is similar to the following command, "
5054
"but with additional effects described below::"
51-
msgstr ""
55+
msgstr "啟用 Python 開發模式類似以下指令,但具有如下所述的附加效果:"
5256

5357
#: ../../library/devmode.rst:26
5458
msgid "Effects of the Python Development Mode:"
55-
msgstr ""
59+
msgstr "Python 開發模式的效果:"
5660

5761
#: ../../library/devmode.rst:28
5862
msgid ""
5963
"Add ``default`` :ref:`warning filter <describing-warning-filters>`. The "
6064
"following warnings are shown:"
6165
msgstr ""
66+
"新增 ``default`` :ref:`警告過濾器 <describing-warning-filters>`。以下警告會被"
67+
"顯示:"
6268

6369
#: ../../library/devmode.rst:31
6470
msgid ":exc:`DeprecationWarning`"
@@ -81,55 +87,61 @@ msgid ""
8187
"Normally, the above warnings are filtered by the default :ref:`warning "
8288
"filters <describing-warning-filters>`."
8389
msgstr ""
90+
"一般來說,上述警告會被預設的\\ :ref:`警告過濾器 <describing-warning-"
91+
"filters>`\\ 給過濾掉。"
8492

8593
#: ../../library/devmode.rst:39
8694
msgid ""
8795
"It behaves as if the :option:`-W default <-W>` command line option is used."
88-
msgstr ""
96+
msgstr "它的行為就像使用 :option:`-W default <-W>` 命令列選項一樣。"
8997

9098
#: ../../library/devmode.rst:41
9199
msgid ""
92100
"Use the :option:`-W error <-W>` command line option or set the :envvar:"
93101
"`PYTHONWARNINGS` environment variable to ``error`` to treat warnings as "
94102
"errors."
95103
msgstr ""
104+
"使用 :option:`-W error <-W>` 命令列選項或將 :envvar:`PYTHONWARNINGS` 環境變數"
105+
"設為 ``error`` 會將警告視為錯誤。"
96106

97107
#: ../../library/devmode.rst:45
98108
msgid "Install debug hooks on memory allocators to check for:"
99-
msgstr ""
109+
msgstr "在記憶體分配器上安裝除錯 hook(掛鉤)以檢查:"
100110

101111
#: ../../library/devmode.rst:47
102112
msgid "Buffer underflow"
103-
msgstr ""
113+
msgstr "緩衝區下溢 (underflow)"
104114

105115
#: ../../library/devmode.rst:48
106116
msgid "Buffer overflow"
107-
msgstr ""
117+
msgstr "緩衝區溢位 (overflow)"
108118

109119
#: ../../library/devmode.rst:49
110120
msgid "Memory allocator API violation"
111-
msgstr ""
121+
msgstr "記憶體分配器 API 違規"
112122

113123
#: ../../library/devmode.rst:50
114124
msgid "Unsafe usage of the GIL"
115-
msgstr ""
125+
msgstr "GIL 的不安全使用"
116126

117127
#: ../../library/devmode.rst:52
118128
msgid "See the :c:func:`PyMem_SetupDebugHooks` C function."
119-
msgstr ""
129+
msgstr "請參閱 :c:func:`PyMem_SetupDebugHooks` C 函式。"
120130

121131
#: ../../library/devmode.rst:54
122132
msgid ""
123133
"It behaves as if the :envvar:`PYTHONMALLOC` environment variable is set to "
124134
"``debug``."
125-
msgstr ""
135+
msgstr "它的行為就好像是將 :envvar:`PYTHONMALLOC` 環境變數設定為 ``debug``。"
126136

127137
#: ../../library/devmode.rst:57
128138
msgid ""
129139
"To enable the Python Development Mode without installing debug hooks on "
130140
"memory allocators, set the :envvar:`PYTHONMALLOC` environment variable to "
131141
"``default``."
132142
msgstr ""
143+
"若要啟用 Python 開發模式而不在記憶體分配器上安裝偵錯 hook,請將 :envvar:"
144+
"`PYTHONMALLOC` 環境變數設為 ``default``。"
133145

134146
#: ../../library/devmode.rst:61
135147
msgid ""
@@ -138,49 +150,62 @@ msgid ""
138150
"SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to "
139151
"dump the Python traceback on a crash."
140152
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)。"
141157

142158
#: ../../library/devmode.rst:66
143159
msgid ""
144160
"It behaves as if the :option:`-X faulthandler <-X>` command line option is "
145161
"used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to "
146162
"``1``."
147163
msgstr ""
164+
"它的行為就像使用 :option:`-X faulthandler <-X>` 命令列選項或將 :envvar:"
165+
"`PYTHONFAULTHANDLER` 環境變數設定為 ``1``。"
148166

149167
#: ../../library/devmode.rst:70
150168
msgid ""
151169
"Enable :ref:`asyncio debug mode <asyncio-debug-mode>`. For example, :mod:"
152170
"`asyncio` checks for coroutines that were not awaited and logs them."
153171
msgstr ""
172+
"啟用 :ref:`asyncio 除錯模式 <asyncio-debug-mode>`。例如 :mod:`asyncio` 會檢查"
173+
"未被等待的 (not awaited) 協程並記錄 (log) 它們。"
154174

155175
#: ../../library/devmode.rst:73
156176
msgid ""
157177
"It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is "
158178
"set to ``1``."
159-
msgstr ""
179+
msgstr "它的行為就像將 :envvar:`PYTHONASYNCIODEBUG` 環境變數設定為 1 一樣。"
160180

161181
#: ../../library/devmode.rst:76
162182
msgid ""
163183
"Check the *encoding* and *errors* arguments for string encoding and decoding "
164184
"operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes."
165185
"decode`."
166186
msgstr ""
187+
"檢查字串編碼和解碼操作的 *encoding* 和 *errors* 引數。範例::func:`open`、:"
188+
"meth:`str.encode` 和 :meth:`bytes.decode`。"
167189

168190
#: ../../library/devmode.rst:80
169191
msgid ""
170192
"By default, for best performance, the *errors* argument is only checked at "
171193
"the first encoding/decoding error and the *encoding* argument is sometimes "
172194
"ignored for empty strings."
173195
msgstr ""
196+
"預設情況下,為了獲得最佳效能,僅在第一個編碼/解碼錯誤時檢查 *errors* 引數,並"
197+
"且有時會因為是空字串而忽略 *encoding* 引數。"
174198

175199
#: ../../library/devmode.rst:84
176200
msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions."
177-
msgstr ""
201+
msgstr ":class:`io.IOBase` 解構函式會記錄 ``close()`` 例外。"
178202

179203
#: ../../library/devmode.rst:85
180204
msgid ""
181205
"Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to "
182206
"``True``."
183207
msgstr ""
208+
"將 :data:`sys.flags` 的 :attr:`~sys.flags.dev_mode` 屬性設為 ``True``。"
184209

185210
#: ../../library/devmode.rst:88
186211
msgid ""
@@ -192,29 +217,37 @@ msgid ""
192217
"buffer overflow error logs the traceback where the memory block was "
193218
"allocated."
194219
msgstr ""
220+
"Python 開發模式預設不會啟用 :mod:`tracemalloc` 模組,因為(效能和記憶體的)開"
221+
"銷太大。啟用 :mod:`tracemalloc` 模組可提供有關某些錯誤來源的附加資訊。例如 :"
222+
"exc:`ResourceWarning` 記錄了分配資源之處的回溯、緩衝區溢位錯誤記錄了分配記憶"
223+
"體區塊的回溯。"
195224

196225
#: ../../library/devmode.rst:95
197226
msgid ""
198227
"The Python Development Mode does not prevent the :option:`-O` command line "
199228
"option from removing :keyword:`assert` statements nor from setting :const:"
200229
"`__debug__` to ``False``."
201230
msgstr ""
231+
"Python 開發模式不會防止 :option:`-O` 命令列選項刪除 :keyword:`assert` 陳述"
232+
"式,也不會防止將 :const:`__debug__` 設定為 ``False``。"
202233

203234
#: ../../library/devmode.rst:99
204235
msgid ""
205236
"The Python Development Mode can only be enabled at the Python startup. Its "
206237
"value can be read from :data:`sys.flags.dev_mode <sys.flags>`."
207238
msgstr ""
239+
"Python 開發模式只能在 Python 啟動時啟用。它的值可以從 :data:`sys.flags."
240+
"dev_mode <sys.flags>` 讀取。"
208241

209242
#: ../../library/devmode.rst:102
210243
msgid "The :class:`io.IOBase` destructor now logs ``close()`` exceptions."
211-
msgstr ""
244+
msgstr ":class:`io.IOBase` 解構函式現在會記錄 ``close()`` 例外。"
212245

213246
#: ../../library/devmode.rst:105
214247
msgid ""
215248
"The *encoding* and *errors* arguments are now checked for string encoding "
216249
"and decoding operations."
217-
msgstr ""
250+
msgstr "現在會為字串編碼和解碼操作檢查 *encoding* 和 *errors* 引數。"
218251

219252
#: ../../library/devmode.rst:111
220253
msgid "ResourceWarning Example"
@@ -224,30 +257,32 @@ msgstr "ResourceWarning 範例"
224257
msgid ""
225258
"Example of a script counting the number of lines of the text file specified "
226259
"in the command line::"
227-
msgstr ""
260+
msgstr "計算命令列中指定的文字檔案列數的腳本範例: ::"
228261

229262
#: ../../library/devmode.rst:127
230263
msgid ""
231264
"The script does not close the file explicitly. By default, Python does not "
232265
"emit any warning. Example using README.txt, which has 269 lines:"
233266
msgstr ""
267+
"該腳本不會明確關閉檔案。預設情況下,Python 不會發出任何警告。使用 README.txt "
268+
"的範例,該檔案有 269 列:"
234269

235270
#: ../../library/devmode.rst:135
236271
msgid ""
237272
"Enabling the Python Development Mode displays a :exc:`ResourceWarning` "
238273
"warning:"
239-
msgstr ""
274+
msgstr "啟用 Python 開發模式會顯示 :exc:`ResourceWarning` 警告:"
240275

241276
#: ../../library/devmode.rst:145
242277
msgid ""
243278
"In addition, enabling :mod:`tracemalloc` shows the line where the file was "
244279
"opened:"
245-
msgstr ""
280+
msgstr "此外,啟用 :mod:`tracemalloc` 會顯示檔案被開啟的那一列:"
246281

247282
#: ../../library/devmode.rst:160
248283
msgid ""
249284
"The fix is to close explicitly the file. Example using a context manager::"
250-
msgstr ""
285+
msgstr "修復方法是明確關閉該檔案。使用情境管理器的範例: ::"
251286

252287
#: ../../library/devmode.rst:168
253288
msgid ""
@@ -256,24 +291,29 @@ msgid ""
256291
"CPython, but it is even worse in PyPy. Closing resources explicitly makes an "
257292
"application more deterministic and more reliable."
258293
msgstr ""
294+
"不明確關閉資源可能會使資源開啟的時間比預期的長得多;它可能會在退出 Python 時"
295+
"導致嚴重問題。在 CPython 中很糟糕,但在 PyPy 中更糟。明確關閉資源使應用程式更"
296+
"具確定性和可靠性。"
259297

260298
#: ../../library/devmode.rst:175
261299
msgid "Bad file descriptor error example"
262-
msgstr ""
300+
msgstr "檔案描述器的錯誤範例"
263301

264302
#: ../../library/devmode.rst:177
265303
msgid "Script displaying the first line of itself::"
266-
msgstr ""
304+
msgstr "顯示自身第一行的腳本: ::"
267305

268306
#: ../../library/devmode.rst:190
269307
msgid "By default, Python does not emit any warning:"
270-
msgstr ""
308+
msgstr "預設情況下,Python 不會發出任何警告:"
271309

272310
#: ../../library/devmode.rst:197
273311
msgid ""
274312
"The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad "
275313
"file descriptor\" error when finalizing the file object:"
276314
msgstr ""
315+
"Python 開發模式在最終化 (finalize) 檔案物件時顯示 :exc:`ResourceWarning` 並記"
316+
"錄 \"Bad file descriptor\" 錯誤:"
277317

278318
#: ../../library/devmode.rst:213
279319
msgid ""
@@ -283,9 +323,15 @@ msgid ""
283323
"worst case scenario, closing it twice can lead to a crash (see :issue:"
284324
"`18748` for an example)."
285325
msgstr ""
326+
"``os.close(fp.fileno())`` 會關閉檔案描述器。當檔案物件最終化器 (finalizer) 嘗"
327+
"試再次關閉檔案描述器時,它會失敗並出現 ``Bad file descriptor`` 錯誤。檔案描述"
328+
"器只能關閉一次。在最壞的情況下,將它關閉兩次可能會導致崩潰 (crash)(相關範例"
329+
"請參閱 :issue:`18748`)。"
286330

287331
#: ../../library/devmode.rst:219
288332
msgid ""
289333
"The fix is to remove the ``os.close(fp.fileno())`` line, or open the file "
290334
"with ``closefd=False``."
291335
msgstr ""
336+
"修復方法是刪除 ``os.close(fp.fileno())`` 那列,或使用 ``closefd=False`` 開啟"
337+
"檔案。"

0 commit comments

Comments
 (0)