Skip to content

Commit a15fa13

Browse files
sync with cpython aa485557
1 parent 26376e5 commit a15fa13

1 file changed

Lines changed: 59 additions & 18 deletions

File tree

library/warnings.po

Lines changed: 59 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.14\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2026-02-07 00:19+0000\n"
11+
"POT-Creation-Date: 2026-06-16 00:50+0000\n"
1212
"PO-Revision-Date: 2025-07-14 13:00+0800\n"
1313
"Last-Translator: Dr-XYZ <dr.xyz.tw@gmail.com>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -468,8 +468,8 @@ msgid ""
468468
msgstr ""
469469
"警告過濾器由傳遞給 Python 直譯器命令列的 :option:`-W` 選項和 :envvar:"
470470
"`PYTHONWARNINGS` 環境變數初始化。直譯器會將所有提供條目的引數未經直譯地儲存"
471-
"在 :data:`sys.warnoptions` 中;:mod:`!warnings` 模組在首次引入時會剖析這些引數"
472-
"(無效選項會被忽略,並在向 :data:`sys.stderr` 印出一條訊息後)。"
471+
"在 :data:`sys.warnoptions` 中;:mod:`!warnings` 模組在首次引入時會剖析這些引"
472+
"(無效選項會被忽略,並在向 :data:`sys.stderr` 印出一條訊息後)。"
473473

474474
#: ../../library/warnings.rst:210
475475
msgid ""
@@ -714,7 +714,7 @@ msgstr ""
714714
"出的警告。"
715715

716716
#: ../../library/warnings.rst:333 ../../library/warnings.rst:375
717-
#: ../../library/warnings.rst:632
717+
#: ../../library/warnings.rst:646
718718
msgid ""
719719
"See :ref:`warning-concurrent-safe` for details on the concurrency-safety of "
720720
"the :class:`catch_warnings` context manager when used in programs using "
@@ -1170,14 +1170,15 @@ msgid "Available Context Managers"
11701170
msgstr "可用的情境管理器"
11711171

11721172
#: ../../library/warnings.rst:609
1173+
#, fuzzy
11731174
msgid ""
11741175
"A context manager that copies and, upon exit, restores the warnings filter "
11751176
"and the :func:`showwarning` function. If the *record* argument is :const:"
11761177
"`False` (the default) the context manager returns :class:`None` on entry. If "
11771178
"*record* is :const:`True`, a list is returned that is progressively "
11781179
"populated with objects as seen by a custom :func:`showwarning` function "
1179-
"(which also suppresses output to ``sys.stdout``). Each object in the list "
1180-
"has attributes with the same names as the arguments to :func:`showwarning`."
1180+
"(which also suppresses output to ``sys.stderr``). Each object in the list is "
1181+
"guaranteed to have the following attributes:"
11811182
msgstr ""
11821183
"一個情境管理器,它會複製並在退出時恢復警告過濾器和 :func:`showwarning` 函式。"
11831184
"如果 *record* 引數為 :const:`False`\\ (預設值),情境管理器在進入時回傳 :"
@@ -1186,7 +1187,47 @@ msgstr ""
11861187
"的物件逐步填充。串列中的每個物件都具有與 :func:`showwarning` 的引數同名的屬"
11871188
"性。"
11881189

1190+
#: ../../library/warnings.rst:617
1191+
msgid "``message``: the warning message (an instance of :exc:`Warning`)"
1192+
msgstr ""
1193+
11891194
#: ../../library/warnings.rst:618
1195+
msgid "``category``: the warning category (a subclass of :exc:`Warning`)"
1196+
msgstr ""
1197+
1198+
#: ../../library/warnings.rst:619
1199+
msgid "``filename``: the file name where the warning occurred (:class:`str`)"
1200+
msgstr ""
1201+
1202+
#: ../../library/warnings.rst:620
1203+
msgid "``lineno``: the line number in the file (:class:`int`)"
1204+
msgstr ""
1205+
1206+
#: ../../library/warnings.rst:621
1207+
msgid "``file``: the file object used for output (if any), or ``None``"
1208+
msgstr ""
1209+
1210+
#: ../../library/warnings.rst:622
1211+
msgid "``line``: the line of source code (if available), or ``None``"
1212+
msgstr ""
1213+
1214+
#: ../../library/warnings.rst:623
1215+
msgid ""
1216+
"``source``: the original object that generated the warning (if available), "
1217+
"or ``None``"
1218+
msgstr ""
1219+
1220+
#: ../../library/warnings.rst:626
1221+
msgid "The ``source`` attribute was added."
1222+
msgstr ""
1223+
1224+
#: ../../library/warnings.rst:629
1225+
msgid ""
1226+
"The type of these objects is not specified and may change; only the presence "
1227+
"of these attributes is guaranteed."
1228+
msgstr ""
1229+
1230+
#: ../../library/warnings.rst:632
11901231
msgid ""
11911232
"The *module* argument takes a module that will be used instead of the module "
11921233
"returned when you import :mod:`!warnings` whose filter will be protected. "
@@ -1196,7 +1237,7 @@ msgstr ""
11961237
"*module* 引數接受一個模組,用以取代預設的 :mod:`!warnings` 模組,而該(被傳"
11971238
"入)模組的過濾器將會受到保護。此引數主要用於測試 :mod:`!warnings` 模組本身。"
11981239

1199-
#: ../../library/warnings.rst:623
1240+
#: ../../library/warnings.rst:637
12001241
msgid ""
12011242
"If the *action* argument is not ``None``, the remaining arguments are passed "
12021243
"to :func:`simplefilter` as if it were called immediately on entering the "
@@ -1205,21 +1246,21 @@ msgstr ""
12051246
"如果 *action* 引數不是 ``None``,則其餘引數會傳遞給 :func:`simplefilter`,就"
12061247
"像在進入情境時立即呼叫它一樣。"
12071248

1208-
#: ../../library/warnings.rst:627
1249+
#: ../../library/warnings.rst:641
12091250
msgid ""
12101251
"See :ref:`warning-filter` for the meaning of the *category* and *lineno* "
12111252
"parameters."
12121253
msgstr "有關 *category* 和 *lineno* 參數的含義,請參閱 :ref:`warning-filter`。"
12131254

1214-
#: ../../library/warnings.rst:639
1255+
#: ../../library/warnings.rst:653
12151256
msgid "Added the *action*, *category*, *lineno*, and *append* parameters."
12161257
msgstr "新增 *action*、*category*、*lineno* 和 *append* 參數。"
12171258

1218-
#: ../../library/warnings.rst:645
1259+
#: ../../library/warnings.rst:659
12191260
msgid "Concurrent safety of Context Managers"
12201261
msgstr "情境管理器的並行安全性"
12211262

1222-
#: ../../library/warnings.rst:647
1263+
#: ../../library/warnings.rst:661
12231264
msgid ""
12241265
"The behavior of :class:`catch_warnings` context manager depends on the :data:"
12251266
"`sys.flags.context_aware_warnings` flag. If the flag is true, the context "
@@ -1230,7 +1271,7 @@ msgid ""
12301271
"threaded builds and false otherwise."
12311272
msgstr ""
12321273

1233-
#: ../../library/warnings.rst:655
1274+
#: ../../library/warnings.rst:669
12341275
msgid ""
12351276
"If the :data:`~sys.flags.context_aware_warnings` flag is false, then :class:"
12361277
"`catch_warnings` will modify the global attributes of the :mod:`!warnings` "
@@ -1240,7 +1281,7 @@ msgid ""
12401281
"is undefined."
12411282
msgstr ""
12421283

1243-
#: ../../library/warnings.rst:662
1284+
#: ../../library/warnings.rst:676
12441285
msgid ""
12451286
"If the flag is true, :class:`catch_warnings` will not modify global "
12461287
"attributes and will instead use a :class:`~contextvars.ContextVar` to store "
@@ -1249,30 +1290,30 @@ msgid ""
12491290
"safe."
12501291
msgstr ""
12511292

1252-
#: ../../library/warnings.rst:668
1293+
#: ../../library/warnings.rst:682
12531294
msgid ""
12541295
"The *record* parameter of the context handler also behaves differently "
12551296
"depending on the value of the flag. When *record* is true and the flag is "
12561297
"false, the context manager works by replacing and then later restoring the "
12571298
"module's :func:`showwarning` function. That is not concurrent-safe."
12581299
msgstr ""
12591300

1260-
#: ../../library/warnings.rst:673
1301+
#: ../../library/warnings.rst:687
12611302
msgid ""
12621303
"When *record* is true and the flag is true, the :func:`showwarning` function "
12631304
"is not replaced. Instead, the recording status is indicated by an internal "
12641305
"property in the context variable. In this case, the :func:`showwarning` "
12651306
"function will not be restored when exiting the context handler."
12661307
msgstr ""
12671308

1268-
#: ../../library/warnings.rst:678
1309+
#: ../../library/warnings.rst:692
12691310
msgid ""
12701311
"The :data:`~sys.flags.context_aware_warnings` flag can be set the :option:`-"
12711312
"X context_aware_warnings<-X>` command-line option or by the :envvar:"
12721313
"`PYTHON_CONTEXT_AWARE_WARNINGS` environment variable."
12731314
msgstr ""
12741315

1275-
#: ../../library/warnings.rst:684
1316+
#: ../../library/warnings.rst:698
12761317
msgid ""
12771318
"It is likely that most programs that desire thread-safe behaviour of the "
12781319
"warnings module will also want to set the :data:`~sys.flags."
@@ -1285,7 +1326,7 @@ msgid ""
12851326
"`catch_warnings` context manager will no longer be active."
12861327
msgstr ""
12871328

1288-
#: ../../library/warnings.rst:697
1329+
#: ../../library/warnings.rst:711
12891330
msgid ""
12901331
"Added the :data:`sys.flags.context_aware_warnings` flag and the use of a "
12911332
"context variable for :class:`catch_warnings` if the flag is true. Previous "

0 commit comments

Comments
 (0)