From abf5a67f73df8d1de019b5098461c3c7f7591ef4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 25 Oct 2025 22:22:02 +0000 Subject: [PATCH 01/12] sync with cpython 62c9d483 --- c-api/capsule.po | 4 ++-- c-api/code.po | 54 +++++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/c-api/capsule.po b/c-api/capsule.po index a322f2fd22..8caf48d64a 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-29 00:17+0000\n" +"POT-Creation-Date: 2025-10-25 22:20+0000\n" "PO-Revision-Date: 2018-05-23 14:30+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,7 +29,7 @@ msgstr "" #: ../../c-api/capsule.rst:17 msgid "" "This subtype of :c:type:`PyObject` represents an opaque value, useful for C " -"extension modules who need to pass an opaque value (as a :c:expr:`void*` " +"extension modules which need to pass an opaque value (as a :c:expr:`void*` " "pointer) through Python code to other C code. It is often used to make a C " "function pointer defined in one module available to other modules, so the " "regular import mechanism can be used to access C APIs defined in dynamically " diff --git a/c-api/code.po b/c-api/code.po index 46a1a245fa..f920a88711 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-10-25 22:20+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,8 +36,8 @@ msgstr "" #: ../../c-api/code.rst:24 msgid "" -"This is an instance of :c:type:`PyTypeObject` representing the " -"Python :ref:`code object `." +"This is an instance of :c:type:`PyTypeObject` representing the Python :ref:" +"`code object `." msgstr "" #: ../../c-api/code.rst:30 @@ -73,9 +73,8 @@ msgstr "" #: ../../c-api/code.rst:54 msgid "" -"Since the definition of the bytecode changes often, " -"calling :c:func:`PyUnstable_Code_New` directly can bind you to a precise " -"Python version." +"Since the definition of the bytecode changes often, calling :c:func:" +"`PyUnstable_Code_New` directly can bind you to a precise Python version." msgstr "" #: ../../c-api/code.rst:57 @@ -132,9 +131,8 @@ msgstr "" #: ../../c-api/code.rst:101 msgid "" -"For efficiently iterating over the line numbers in a code object, " -"use :pep:`the API described in PEP 626 <0626#out-of-process-debuggers-and-" -"profilers>`." +"For efficiently iterating over the line numbers in a code object, use :pep:" +"`the API described in PEP 626 <0626#out-of-process-debuggers-and-profilers>`." msgstr "" #: ../../c-api/code.rst:106 @@ -180,9 +178,9 @@ msgstr "" #: ../../c-api/code.rst:147 msgid "" "Equivalent to the Python code ``getattr(co, 'co_freevars')``. Returns a new " -"reference to a :c:type:`PyTupleObject` containing the names of " -"the :term:`free (closure) variables `. On error, ``NULL`` " -"is returned and an exception is raised." +"reference to a :c:type:`PyTupleObject` containing the names of the :term:" +"`free (closure) variables `. On error, ``NULL`` is " +"returned and an exception is raised." msgstr "" #: ../../c-api/code.rst:156 @@ -195,10 +193,10 @@ msgstr "" #: ../../c-api/code.rst:165 msgid "" -"Clear watcher identified by *watcher_id* previously returned " -"from :c:func:`PyCode_AddWatcher` for the current interpreter. Return ``0`` " -"on success, or ``-1`` and set an exception on error (e.g. if the given " -"*watcher_id* was never registered.)" +"Clear watcher identified by *watcher_id* previously returned from :c:func:" +"`PyCode_AddWatcher` for the current interpreter. Return ``0`` on success, or " +"``-1`` and set an exception on error (e.g. if the given *watcher_id* was " +"never registered.)" msgstr "" #: ../../c-api/code.rst:174 @@ -240,8 +238,8 @@ msgstr "" #: ../../c-api/code.rst:201 msgid "" "If the callback sets an exception, it must return ``-1``; this exception " -"will be printed as an unraisable exception " -"using :c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``." +"will be printed as an unraisable exception using :c:func:" +"`PyErr_WriteUnraisable`. Otherwise it should return ``0``." msgstr "" #: ../../c-api/code.rst:205 @@ -259,18 +257,18 @@ msgstr "程式碼物件旗標" #: ../../c-api/code.rst:219 msgid "" -"Code objects contain a bit-field of flags, which can be retrieved as " -"the :attr:`~codeobject.co_flags` Python attribute (for example " -"using :c:func:`PyObject_GetAttrString`), and set using a *flags* argument " -"to :c:func:`PyUnstable_Code_New` and similar functions." +"Code objects contain a bit-field of flags, which can be retrieved as the :" +"attr:`~codeobject.co_flags` Python attribute (for example using :c:func:" +"`PyObject_GetAttrString`), and set using a *flags* argument to :c:func:" +"`PyUnstable_Code_New` and similar functions." msgstr "" #: ../../c-api/code.rst:224 msgid "" "Flags whose names start with ``CO_FUTURE_`` correspond to features normally " -"selectable by :ref:`future statements `. These flags can be used " -"in :c:member:`PyCompilerFlags.cf_flags`. Note that many ``CO_FUTURE_`` flags " -"are mandatory in current versions of Python, and setting them has no effect." +"selectable by :ref:`future statements `. These flags can be used in :" +"c:member:`PyCompilerFlags.cf_flags`. Note that many ``CO_FUTURE_`` flags are " +"mandatory in current versions of Python, and setting them has no effect." msgstr "" #: ../../c-api/code.rst:230 @@ -378,7 +376,7 @@ msgid "" msgstr "" #: ../../c-api/code.rst:292 -msgid "Return a new an opaque index value used to adding data to code objects." +msgid "Return a new opaque index value used to adding data to code objects." msgstr "" #: ../../c-api/code.rst:294 @@ -391,8 +389,8 @@ msgstr "" #: ../../c-api/code.rst:298 msgid "" "If *free* is not ``NULL``: when a code object is deallocated, *free* will be " -"called on non-``NULL`` data stored under the new index. " -"Use :c:func:`Py_DecRef` when storing :c:type:`PyObject`." +"called on non-``NULL`` data stored under the new index. Use :c:func:" +"`Py_DecRef` when storing :c:type:`PyObject`." msgstr "" #: ../../c-api/code.rst:304 From 49ea8fe6dd0c55204fd299168f989c73ce9ab5a1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 26 Oct 2025 00:16:47 +0000 Subject: [PATCH 02/12] sync with cpython 59611154 --- library/concurrent.futures.po | 172 +++++++++++++++++----------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 0db2ac39ec..27a025e3b4 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-12 00:14+0000\n" +"POT-Creation-Date: 2025-10-26 00:15+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,9 +210,9 @@ msgid "" "shutdown the :class:`Executor` (waiting as if :meth:`Executor.shutdown` were " "called with *wait* set to ``True``)::" msgstr "" -"如果使用 :keyword:`with` 陳述式來將 executor 用作 :term:`context manager`,那你就" -"可以不用明確地呼叫此方法,這將會自己關閉 :class:`Executor`\\(如同呼" -"叫 :meth:`Executor.shutdown` 時 *wait* 被設定為 ``True`` 般等待): ::" +"如果使用 :keyword:`with` 陳述式來將 executor 用作 :term:`context manager`,那" +"你就可以不用明確地呼叫此方法,這將會自己關閉 :class:`Executor`\\(如同呼叫 :" +"meth:`Executor.shutdown` 時 *wait* 被設定為 ``True`` 般等待): ::" #: ../../library/concurrent.futures.rst:109 msgid "" @@ -371,7 +371,7 @@ msgstr "" "thread) 的 :class:`threading.Thread` 名稱,以便於除錯。" #: ../../library/concurrent.futures.rst:188 -#: ../../library/concurrent.futures.rst:391 +#: ../../library/concurrent.futures.rst:393 msgid "Added the *initializer* and *initargs* arguments." msgstr "新增 *initializer* 與 *initargs* 引數。" @@ -440,7 +440,7 @@ msgstr "" msgid "InterpreterPoolExecutor" msgstr "InterpreterPoolExecutor" -#: ../../library/concurrent.futures.rst:242 +#: ../../library/concurrent.futures.rst:244 msgid "" "The :class:`InterpreterPoolExecutor` class uses a pool of interpreters to " "execute calls asynchronously. It is a :class:`ThreadPoolExecutor` subclass, " @@ -449,7 +449,7 @@ msgid "" "interpreter." msgstr "" -#: ../../library/concurrent.futures.rst:248 +#: ../../library/concurrent.futures.rst:250 msgid "" "The biggest benefit to using interpreters instead of only threads is true " "multi-core parallelism. Each interpreter has its own :term:`Global " @@ -458,7 +458,7 @@ msgid "" "unblocked on a different core." msgstr "" -#: ../../library/concurrent.futures.rst:254 +#: ../../library/concurrent.futures.rst:256 msgid "" "The tradeoff is that writing concurrent code for use with multiple " "interpreters can take extra effort. However, this is because it forces you " @@ -471,7 +471,7 @@ msgid "" "conditions." msgstr "" -#: ../../library/concurrent.futures.rst:264 +#: ../../library/concurrent.futures.rst:266 msgid "" "Each worker's interpreter is isolated from all the other interpreters. " "\"Isolated\" means each interpreter has its own runtime state and operates " @@ -485,7 +485,7 @@ msgid "" "``__main__``." msgstr "" -#: ../../library/concurrent.futures.rst:276 +#: ../../library/concurrent.futures.rst:278 msgid "" "Isolation means a mutable object, or other data, cannot be used by more than " "one interpreter at the same time. That effectively means interpreters " @@ -495,7 +495,7 @@ msgid "" "strings, and tuples of immutable objects, don't have these limitations." msgstr "" -#: ../../library/concurrent.futures.rst:284 +#: ../../library/concurrent.futures.rst:286 msgid "" "Communicating and synchronizing between interpreters is most effectively " "done using dedicated tools, like those proposed in :pep:`734`. One less " @@ -503,7 +503,7 @@ msgid "" "bytes over a shared :mod:`socket ` or :func:`pipe `." msgstr "" -#: ../../library/concurrent.futures.rst:292 +#: ../../library/concurrent.futures.rst:294 msgid "" "A :class:`ThreadPoolExecutor` subclass that executes calls asynchronously " "using a pool of at most *max_workers* threads. Each thread runs tasks in " @@ -514,7 +514,7 @@ msgid "" "executor has true multi-core parallelism." msgstr "" -#: ../../library/concurrent.futures.rst:300 +#: ../../library/concurrent.futures.rst:302 msgid "" "The optional *initializer* and *initargs* arguments have the same meaning as " "for :class:`!ThreadPoolExecutor`: the initializer is run when each worker is " @@ -523,17 +523,17 @@ msgid "" "when sending them to the worker's interpreter." msgstr "" -#: ../../library/concurrent.futures.rst:308 +#: ../../library/concurrent.futures.rst:310 msgid "" "The executor may replace uncaught exceptions from *initializer* with :class:" "`~concurrent.futures.interpreter.ExecutionFailed`." msgstr "" -#: ../../library/concurrent.futures.rst:311 +#: ../../library/concurrent.futures.rst:313 msgid "Other caveats from parent :class:`ThreadPoolExecutor` apply here." msgstr "" -#: ../../library/concurrent.futures.rst:313 +#: ../../library/concurrent.futures.rst:315 msgid "" ":meth:`~Executor.submit` and :meth:`~Executor.map` work like normal, except " "the worker serializes the callable and arguments using :mod:`pickle` when " @@ -541,7 +541,7 @@ msgid "" "value when sending it back." msgstr "" -#: ../../library/concurrent.futures.rst:318 +#: ../../library/concurrent.futures.rst:320 msgid "" "When a worker's current task raises an uncaught exception, the worker always " "tries to preserve the exception as-is. If that is successful then it also " @@ -552,11 +552,11 @@ msgid "" "class:`~concurrent.futures.interpreter.ExecutionFailed` instance instead." msgstr "" -#: ../../library/concurrent.futures.rst:330 +#: ../../library/concurrent.futures.rst:332 msgid "ProcessPoolExecutor" msgstr "ProcessPoolExecutor" -#: ../../library/concurrent.futures.rst:332 +#: ../../library/concurrent.futures.rst:334 msgid "" "The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that " "uses a pool of processes to execute calls asynchronously. :class:" @@ -571,7 +571,7 @@ msgstr "" "Interpreter Lock) `,但也意味著只能執行和回傳可被 " "pickle 的 (picklable) 物件。" -#: ../../library/concurrent.futures.rst:339 +#: ../../library/concurrent.futures.rst:341 msgid "" "The ``__main__`` module must be importable by worker subprocesses. This " "means that :class:`ProcessPoolExecutor` will not work in the interactive " @@ -581,7 +581,7 @@ msgstr "" "class:`ProcessPoolExecutor` 將無法在交互式直譯器 (interactive interpreter) 中" "工作。" -#: ../../library/concurrent.futures.rst:342 +#: ../../library/concurrent.futures.rst:344 msgid "" "Calling :class:`Executor` or :class:`Future` methods from a callable " "submitted to a :class:`ProcessPoolExecutor` will result in deadlock." @@ -589,7 +589,7 @@ msgstr "" "從提交給 :class:`ProcessPoolExecutor` 的可呼叫物件中呼叫 :class:`Executor` " "或 :class:`Future` 方法將導致死鎖。" -#: ../../library/concurrent.futures.rst:345 +#: ../../library/concurrent.futures.rst:347 msgid "" "Note that the restrictions on functions and arguments needing to picklable " "as per :class:`multiprocessing.Process` apply when using :meth:`~Executor." @@ -597,7 +597,7 @@ msgid "" "function defined in a REPL or a lambda should not be expected to work." msgstr "" -#: ../../library/concurrent.futures.rst:352 +#: ../../library/concurrent.futures.rst:354 msgid "" "An :class:`Executor` subclass that executes calls asynchronously using a " "pool of at most *max_workers* processes. If *max_workers* is ``None`` or " @@ -621,7 +621,7 @@ msgstr "" "或未給定,則使用預設的 :mod:`multiprocessing` 情境。請見 :ref:" "`multiprocessing-start-methods`。" -#: ../../library/concurrent.futures.rst:366 +#: ../../library/concurrent.futures.rst:368 msgid "" "*initializer* is an optional callable that is called at the start of each " "worker process; *initargs* is a tuple of arguments passed to the " @@ -634,7 +634,7 @@ msgstr "" "外,所有目前未定的作業以及任何向池中提交更多作業的嘗試都將引發 :exc:" "`~concurrent.futures.process.BrokenProcessPool`。" -#: ../../library/concurrent.futures.rst:372 +#: ../../library/concurrent.futures.rst:374 msgid "" "*max_tasks_per_child* is an optional argument that specifies the maximum " "number of tasks a single process can execute before it will exit and be " @@ -650,7 +650,7 @@ msgstr "" "數的情況下,將預設使用 \"spawn\" 做為 multiprocessing 啟動方法。此功能與 " "\"fork\" 啟動方法不相容。" -#: ../../library/concurrent.futures.rst:380 +#: ../../library/concurrent.futures.rst:382 msgid "" "When one of the worker processes terminates abruptly, a :exc:`~concurrent." "futures.process.BrokenProcessPool` error is now raised. Previously, " @@ -661,21 +661,21 @@ msgstr "" "BrokenProcessPool` 錯誤。在過去,此行為是未定義的 (undefined),但對 executor " "或其 future 的操作經常會發生凍結或死鎖。" -#: ../../library/concurrent.futures.rst:387 +#: ../../library/concurrent.futures.rst:389 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" "新增了 *mp_context* 引數以允許使用者控制由池所建立的工作行程的 start_method。" -#: ../../library/concurrent.futures.rst:393 +#: ../../library/concurrent.futures.rst:395 msgid "" "The *max_tasks_per_child* argument was added to allow users to control the " "lifetime of workers in the pool." msgstr "" "新增了 *max_tasks_per_child* 引數以允許使用者控制池中 worker 的生命週期。" -#: ../../library/concurrent.futures.rst:397 +#: ../../library/concurrent.futures.rst:399 msgid "" "On POSIX systems, if your application has multiple threads and the :mod:" "`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." @@ -688,13 +688,13 @@ msgstr "" "能會引發 :exc:`DeprecationWarning`。傳遞一個 *mp_context* 以配置為使用不同的" "啟動方法。更多說明請參閱 :func:`os.fork` 文件。" -#: ../../library/concurrent.futures.rst:405 +#: ../../library/concurrent.futures.rst:407 msgid "" "*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:" "`os.cpu_count`." msgstr "" -#: ../../library/concurrent.futures.rst:409 +#: ../../library/concurrent.futures.rst:411 msgid "" "The default process start method (see :ref:`multiprocessing-start-methods`) " "changed away from *fork*. If you require the *fork* start method for :class:" @@ -702,7 +702,7 @@ msgid "" "get_context(\"fork\")``." msgstr "" -#: ../../library/concurrent.futures.rst:417 +#: ../../library/concurrent.futures.rst:419 msgid "" "Attempt to terminate all living worker processes immediately by calling :" "meth:`Process.terminate ` on each of " @@ -710,14 +710,14 @@ msgid "" "all other resources associated with the executor are freed." msgstr "" -#: ../../library/concurrent.futures.rst:422 -#: ../../library/concurrent.futures.rst:434 +#: ../../library/concurrent.futures.rst:424 +#: ../../library/concurrent.futures.rst:436 msgid "" "After calling this method the caller should no longer submit tasks to the " "executor." msgstr "" -#: ../../library/concurrent.futures.rst:429 +#: ../../library/concurrent.futures.rst:431 msgid "" "Attempt to kill all living worker processes immediately by calling :meth:" "`Process.kill ` on each of them. Internally, " @@ -725,11 +725,11 @@ msgid "" "resources associated with the executor are freed." msgstr "" -#: ../../library/concurrent.futures.rst:442 +#: ../../library/concurrent.futures.rst:444 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:445 +#: ../../library/concurrent.futures.rst:447 msgid "" "import concurrent.futures\n" "import math\n" @@ -797,11 +797,11 @@ msgstr "" "if __name__ == '__main__':\n" " main()" -#: ../../library/concurrent.futures.rst:480 +#: ../../library/concurrent.futures.rst:482 msgid "Future Objects" msgstr "Future 物件" -#: ../../library/concurrent.futures.rst:482 +#: ../../library/concurrent.futures.rst:484 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." @@ -809,7 +809,7 @@ msgstr "" ":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例由 :" "meth:`Executor.submit` 建立。" -#: ../../library/concurrent.futures.rst:487 +#: ../../library/concurrent.futures.rst:489 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " @@ -818,7 +818,7 @@ msgstr "" "封裝可呼叫物件的非同步執行。:class:`Future` 實例由 :meth:`Executor.submit` 建" "立,且除測試外不應直接建立。" -#: ../../library/concurrent.futures.rst:493 +#: ../../library/concurrent.futures.rst:495 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -828,22 +828,22 @@ msgstr "" "嘗試取消呼叫。如果呼叫目前正在執行或已完成運行且無法取消,則該方法將回傳 " "``False``,否則呼叫將被取消並且該方法將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:500 +#: ../../library/concurrent.futures.rst:502 msgid "Return ``True`` if the call was successfully cancelled." msgstr "如果該呼叫成功被取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:504 +#: ../../library/concurrent.futures.rst:506 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "如果呼叫正在執行且無法取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:509 +#: ../../library/concurrent.futures.rst:511 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "如果呼叫成功被取消或結束運行,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:514 +#: ../../library/concurrent.futures.rst:516 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -855,19 +855,19 @@ msgstr "" "叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。*timeout* 可以是整數" "或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:521 -#: ../../library/concurrent.futures.rst:535 +#: ../../library/concurrent.futures.rst:523 +#: ../../library/concurrent.futures.rst:537 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "如果 future 在完成之前被取消,那麼 :exc:`.CancelledError` 將被引發。" -#: ../../library/concurrent.futures.rst:524 +#: ../../library/concurrent.futures.rst:526 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "如果該呼叫引發了例外,此方法將引發相同的例外。" -#: ../../library/concurrent.futures.rst:528 +#: ../../library/concurrent.futures.rst:530 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -879,11 +879,11 @@ msgstr "" "呼叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。 *timeout* 可以是" "整數或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:538 +#: ../../library/concurrent.futures.rst:540 msgid "If the call completed without raising, ``None`` is returned." msgstr "如果呼叫在沒有引發的情況下完成,則回傳 ``None``。" -#: ../../library/concurrent.futures.rst:542 +#: ../../library/concurrent.futures.rst:544 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " @@ -892,7 +892,7 @@ msgstr "" "將可呼叫的 *fn* 附加到 future 上。當 future 被取消或完成運行時,*fn* 將被以 " "future 作為其唯一引數來呼叫。" -#: ../../library/concurrent.futures.rst:546 +#: ../../library/concurrent.futures.rst:548 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -904,19 +904,19 @@ msgstr "" "如果可呼叫物件引發 :exc:`Exception` 子類別,它將被記錄 (log) 並忽略。如果可呼" "叫物件引發 :exc:`BaseException` 子類別,該行為未定義。" -#: ../../library/concurrent.futures.rst:552 +#: ../../library/concurrent.futures.rst:554 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "如果 future 已經完成或被取消,*fn* 將立即被呼叫。" -#: ../../library/concurrent.futures.rst:555 +#: ../../library/concurrent.futures.rst:557 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." msgstr "以下 :class:`Future` 方法旨在用於單元測試和 :class:`Executor` 實作。" -#: ../../library/concurrent.futures.rst:560 +#: ../../library/concurrent.futures.rst:562 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " @@ -925,7 +925,7 @@ msgstr "" "此方法只能在與 :class:`Future` 關聯的工作被執行之前於 :class:`Executor` 實作" "中呼叫,或者在單元測試中呼叫。" -#: ../../library/concurrent.futures.rst:564 +#: ../../library/concurrent.futures.rst:566 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned ``True``. Any threads " @@ -936,7 +936,7 @@ msgstr "" "cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成的執行緒(即透" "過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" -#: ../../library/concurrent.futures.rst:569 +#: ../../library/concurrent.futures.rst:571 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " @@ -945,7 +945,7 @@ msgstr "" "如果該方法回傳 ``True`` 則代表 :class:`Future` 未被取消並已進入運行狀態,意即" "呼叫 :meth:`Future.running` 將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:573 +#: ../../library/concurrent.futures.rst:575 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." @@ -953,20 +953,20 @@ msgstr "" "此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` 或 :meth:`Future." "set_exception` 之後呼叫。" -#: ../../library/concurrent.futures.rst:579 +#: ../../library/concurrent.futures.rst:581 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "將與 :class:`Future` 關聯的工作結果設定為 *result*。" -#: ../../library/concurrent.futures.rst:582 -#: ../../library/concurrent.futures.rst:595 +#: ../../library/concurrent.futures.rst:584 +#: ../../library/concurrent.futures.rst:597 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "此方法只能在 :class:`Executor` 實作中和單元測試中使用。" -#: ../../library/concurrent.futures.rst:585 -#: ../../library/concurrent.futures.rst:598 +#: ../../library/concurrent.futures.rst:587 +#: ../../library/concurrent.futures.rst:600 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." @@ -974,18 +974,18 @@ msgstr "" "如果 :class:`Future` 已經完成,此方法會引發 :exc:`concurrent.futures." "InvalidStateError`。" -#: ../../library/concurrent.futures.rst:592 +#: ../../library/concurrent.futures.rst:594 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" "將與 :class:`Future` 關聯的工作結果設定為 :class:`Exception` *exception*。" -#: ../../library/concurrent.futures.rst:604 +#: ../../library/concurrent.futures.rst:606 msgid "Module Functions" msgstr "模組函式" -#: ../../library/concurrent.futures.rst:608 +#: ../../library/concurrent.futures.rst:610 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -1001,7 +1001,7 @@ msgstr "" "完成的 future(已完成或被取消的 future)。第二組名為 ``not_done``,包含未完成" "的 future(未定或運行中的 future)。" -#: ../../library/concurrent.futures.rst:616 +#: ../../library/concurrent.futures.rst:618 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " @@ -1010,25 +1010,25 @@ msgstr "" "*timeout* 可用於控制回傳前等待的最大秒數。*timeout* 可以是整數或浮點數。如果" "未指定 *timeout* 或為 ``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:620 +#: ../../library/concurrent.futures.rst:622 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "*return_when* 表示此函式應回傳的時間。它必須是以下常數之一:" -#: ../../library/concurrent.futures.rst:626 +#: ../../library/concurrent.futures.rst:628 msgid "Constant" msgstr "常數" -#: ../../library/concurrent.futures.rst:627 +#: ../../library/concurrent.futures.rst:629 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:630 +#: ../../library/concurrent.futures.rst:632 msgid "The function will return when any future finishes or is cancelled." msgstr "當任何 future 完成或被取消時,該函式就會回傳。" -#: ../../library/concurrent.futures.rst:633 +#: ../../library/concurrent.futures.rst:635 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" @@ -1037,11 +1037,11 @@ msgstr "" "該函式會在任何 future 透過引發例外而完結時回傳。如果 future 沒有引發例外,那" "麼它等同於 :const:`ALL_COMPLETED`。" -#: ../../library/concurrent.futures.rst:638 +#: ../../library/concurrent.futures.rst:640 msgid "The function will return when all futures finish or are cancelled." msgstr "當所有 future 都完成或被取消時,該函式才會回傳。" -#: ../../library/concurrent.futures.rst:642 +#: ../../library/concurrent.futures.rst:644 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -1061,36 +1061,36 @@ msgstr "" "`TimeoutError`。*timeout* 可以是整數或浮點數。如果未指定 *timeout* 或為 " "``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:655 +#: ../../library/concurrent.futures.rst:657 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr ":pep:`3148` -- futures - 非同步地執行運算" -#: ../../library/concurrent.futures.rst:656 +#: ../../library/concurrent.futures.rst:658 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "描述此功能並提出被包含於 Python 標準函式庫中的提案。" -#: ../../library/concurrent.futures.rst:661 +#: ../../library/concurrent.futures.rst:663 msgid "Exception classes" msgstr "例外類別" -#: ../../library/concurrent.futures.rst:667 +#: ../../library/concurrent.futures.rst:669 msgid "Raised when a future is cancelled." msgstr "當 future 被取消時引發。" -#: ../../library/concurrent.futures.rst:671 +#: ../../library/concurrent.futures.rst:673 msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when a future operation " "exceeds the given timeout." msgstr "" ":exc:`TimeoutError` 的棄用別名,在 future 操作超過給定超時 (timeout) 時引發。" -#: ../../library/concurrent.futures.rst:676 +#: ../../library/concurrent.futures.rst:678 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "這個類別是 :exc:`TimeoutError` 的別名。" -#: ../../library/concurrent.futures.rst:681 +#: ../../library/concurrent.futures.rst:683 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " @@ -1099,13 +1099,13 @@ msgstr "" "衍生自 :exc:`RuntimeError`,當執行器因某種原因損壞時會引發此例外類別,並且不" "能用於提交或執行新任務。" -#: ../../library/concurrent.futures.rst:689 +#: ../../library/concurrent.futures.rst:691 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "目前狀態下不允許的 future 操作被執行時而引發。" -#: ../../library/concurrent.futures.rst:698 +#: ../../library/concurrent.futures.rst:700 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`~concurrent.futures." @@ -1114,7 +1114,7 @@ msgstr "" "衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:`~concurrent." "futures.ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" -#: ../../library/concurrent.futures.rst:709 +#: ../../library/concurrent.futures.rst:711 msgid "" "Derived from :exc:`~concurrent.futures.thread.BrokenThreadPool`, this " "exception class is raised when one of the workers of a :class:`~concurrent." @@ -1124,14 +1124,14 @@ msgstr "" "`~concurrent.futures.InterpreterPoolExecutor` 的其中一個 worker 初始化失敗時" "會引發此例外類別。" -#: ../../library/concurrent.futures.rst:718 +#: ../../library/concurrent.futures.rst:720 msgid "" "Raised from :class:`~concurrent.futures.InterpreterPoolExecutor` when the " "given initializer fails or from :meth:`~concurrent.futures.Executor.submit` " "when there's an uncaught exception from the submitted task." msgstr "" -#: ../../library/concurrent.futures.rst:729 +#: ../../library/concurrent.futures.rst:731 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " From 9e1725de0688a98fb36a02b76705bbea513730a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 27 Oct 2025 00:18:01 +0000 Subject: [PATCH 03/12] sync with cpython 842c49b3 --- c-api/codec.po | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/c-api/codec.po b/c-api/codec.po index 19e1d21e7f..39234b8587 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2025-10-27 00:16+0000\n" "PO-Revision-Date: 2023-07-24 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,9 +27,11 @@ msgid "Register a new codec search function." msgstr "註冊一個新的編解碼器搜尋函式。" #: ../../c-api/codec.rst:10 +#, fuzzy msgid "" -"As side effect, this tries to load the :mod:`!encodings` package, if not yet " -"done, to make sure that it is always first in the list of search functions." +"As a side effect, this tries to load the :mod:`!encodings` package, if not " +"yet done, to make sure that it is always first in the list of search " +"functions." msgstr "" "作為副作用 (side effect),這會嘗試載入 :mod:`!encodings`\\ (如果尚未完成)," "以確保它始終位於搜尋函式列表中的第一個。" From 73ae28fc80d7a19af4d0c6645bef8aebb5532c5f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Oct 2025 00:15:54 +0000 Subject: [PATCH 04/12] sync with cpython 2e216728 --- c-api/codec.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/c-api/codec.po b/c-api/codec.po index 39234b8587..185fa92c22 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-27 00:16+0000\n" +"POT-Creation-Date: 2025-10-28 00:14+0000\n" "PO-Revision-Date: 2023-07-24 17:51+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -73,11 +73,12 @@ msgid "Generic codec based decoding API." msgstr "基於泛用編解碼器的解碼 API。" #: ../../c-api/codec.rst:39 +#, fuzzy msgid "" "*object* is passed through the decoder function found for the given " "*encoding* using the error handling method defined by *errors*. *errors* " "may be ``NULL`` to use the default method defined for the codec. Raises a :" -"exc:`LookupError` if no encoder can be found." +"exc:`LookupError` if no decoder can be found." msgstr "" "*object* 被傳遞給以給定 *encoding* 所查找到的解碼器函式,並使用以 *errors* 定" "義的錯誤處理方法。*errors* 可以設為 ``NULL`` 來使用編解碼器定義的預設方法。如" From e0095f96217180e7442b60e0e7af3e9f48b30179 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 31 Oct 2025 00:16:18 +0000 Subject: [PATCH 05/12] sync with cpython 6c025a04 --- library/logging.po | 245 +++++++++++++++++++++++---------------------- 1 file changed, 126 insertions(+), 119 deletions(-) diff --git a/library/logging.po b/library/logging.po index 93e609050e..bd7d720491 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-17 00:13+0000\n" +"POT-Creation-Date: 2025-10-31 00:14+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1313,11 +1313,11 @@ msgstr "" msgid "Attribute name" msgstr "屬性名稱" -#: ../../library/logging.rst:995 ../../library/logging.rst:1365 +#: ../../library/logging.rst:995 ../../library/logging.rst:1370 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:995 ../../library/logging.rst:1365 +#: ../../library/logging.rst:995 ../../library/logging.rst:1370 msgid "Description" msgstr "描述" @@ -1623,14 +1623,15 @@ msgstr "" #: ../../library/logging.rst:1087 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " -"underlying :class:`Logger` instance, a dict-like object (*extra*), and a " -"boolean (*merge_extra*) indicating whether or not the *extra* argument of " -"individual log calls should be merged with the :class:`LoggerAdapter` extra. " -"The default behavior is to ignore the *extra* argument of individual log " -"calls and only use the one of the :class:`LoggerAdapter` instance" +"underlying :class:`Logger` instance, an optional dict-like object (*extra*), " +"and an optional boolean (*merge_extra*) indicating whether or not the " +"*extra* argument of individual log calls should be merged with the :class:" +"`LoggerAdapter` extra. The default behavior is to ignore the *extra* " +"argument of individual log calls and only use the one of the :class:" +"`LoggerAdapter` instance" msgstr "" -#: ../../library/logging.rst:1096 +#: ../../library/logging.rst:1097 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1639,15 +1640,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1104 +#: ../../library/logging.rst:1105 msgid "Delegates to the underlying :attr:`!manager` on *logger*." msgstr "" -#: ../../library/logging.rst:1108 +#: ../../library/logging.rst:1109 msgid "Delegates to the underlying :meth:`!_log` method on *logger*." msgstr "" -#: ../../library/logging.rst:1110 +#: ../../library/logging.rst:1111 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1659,28 +1660,34 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1121 +#: ../../library/logging.rst:1122 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:1127 +#: ../../library/logging.rst:1128 msgid "" "Attribute :attr:`!manager` and method :meth:`!_log` were added, which " "delegate to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:1132 -msgid "The *merge_extra* argument was added." +#: ../../library/logging.rst:1133 +#, fuzzy +msgid "The *extra* argument is now optional." msgstr "新增 *merge_extra* 引數。" -#: ../../library/logging.rst:1136 +#: ../../library/logging.rst:1137 +#, fuzzy +msgid "The *merge_extra* parameter was added." +msgstr "新增 *merge_extra* 引數。" + +#: ../../library/logging.rst:1141 msgid "Thread Safety" msgstr "執行緒安全" -#: ../../library/logging.rst:1138 +#: ../../library/logging.rst:1143 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this through using threading " @@ -1689,7 +1696,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1143 +#: ../../library/logging.rst:1148 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1697,17 +1704,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1150 +#: ../../library/logging.rst:1155 msgid "Module-Level Functions" msgstr "模組層級函式" -#: ../../library/logging.rst:1152 +#: ../../library/logging.rst:1157 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1158 +#: ../../library/logging.rst:1163 msgid "" "Return a logger with the specified name or, if name is ``None``, return the " "root logger of the hierarchy. If specified, the name is typically a dot-" @@ -1717,14 +1724,14 @@ msgid "" "for not doing that, as mentioned in :ref:`logger`." msgstr "" -#: ../../library/logging.rst:1165 +#: ../../library/logging.rst:1170 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1172 +#: ../../library/logging.rst:1177 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1733,7 +1740,7 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1177 +#: ../../library/logging.rst:1182 msgid "" "class MyLogger(logging.getLoggerClass()):\n" " # ... override behaviour here" @@ -1741,37 +1748,37 @@ msgstr "" "class MyLogger(logging.getLoggerClass()):\n" " # ... 在這裡覆蓋其行為" -#: ../../library/logging.rst:1183 +#: ../../library/logging.rst:1188 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1185 +#: ../../library/logging.rst:1190 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1190 +#: ../../library/logging.rst:1195 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1195 +#: ../../library/logging.rst:1200 msgid "" "This is a convenience function that calls :meth:`Logger.debug`, on the root " "logger. The handling of the arguments is in every way identical to what is " "described in that method." msgstr "" -#: ../../library/logging.rst:1199 +#: ../../library/logging.rst:1204 msgid "" "The only difference is that if the root logger has no handlers, then :func:" "`basicConfig` is called, prior to calling ``debug`` on the root logger." msgstr "" -#: ../../library/logging.rst:1202 +#: ../../library/logging.rst:1207 msgid "" "For very short scripts or quick demonstrations of ``logging`` facilities, " "``debug`` and the other module-level functions may be convenient. However, " @@ -1781,38 +1788,38 @@ msgid "" "described at the beginning of this documentation." msgstr "" -#: ../../library/logging.rst:1212 +#: ../../library/logging.rst:1217 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1218 +#: ../../library/logging.rst:1223 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1221 +#: ../../library/logging.rst:1226 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1228 +#: ../../library/logging.rst:1233 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1234 +#: ../../library/logging.rst:1239 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1240 +#: ../../library/logging.rst:1245 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`. Exception info is " @@ -1820,13 +1827,13 @@ msgid "" "exception handler." msgstr "" -#: ../../library/logging.rst:1246 +#: ../../library/logging.rst:1251 msgid "" "Logs a message with level *level* on the root logger. The arguments and " "behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1251 +#: ../../library/logging.rst:1256 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1840,7 +1847,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1262 +#: ../../library/logging.rst:1267 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1848,13 +1855,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1267 +#: ../../library/logging.rst:1272 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1273 +#: ../../library/logging.rst:1278 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1864,24 +1871,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1280 +#: ../../library/logging.rst:1285 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1285 +#: ../../library/logging.rst:1290 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1293 +#: ../../library/logging.rst:1298 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1295 +#: ../../library/logging.rst:1300 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1891,20 +1898,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1302 +#: ../../library/logging.rst:1307 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1306 +#: ../../library/logging.rst:1311 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1309 +#: ../../library/logging.rst:1314 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -1913,7 +1920,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1315 +#: ../../library/logging.rst:1320 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1921,17 +1928,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1323 +#: ../../library/logging.rst:1328 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1330 +#: ../../library/logging.rst:1335 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1336 +#: ../../library/logging.rst:1341 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1939,7 +1946,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1344 +#: ../../library/logging.rst:1349 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1948,13 +1955,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1350 +#: ../../library/logging.rst:1355 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1353 +#: ../../library/logging.rst:1358 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1963,54 +1970,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1360 +#: ../../library/logging.rst:1365 msgid "The following keyword arguments are supported." msgstr "支援以下的關鍵字引數。" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1372 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1372 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1376 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1371 +#: ../../library/logging.rst:1376 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1380 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1380 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1385 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1385 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1383 +#: ../../library/logging.rst:1388 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1383 +#: ../../library/logging.rst:1388 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1394 +#: ../../library/logging.rst:1399 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1394 +#: ../../library/logging.rst:1399 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1400 +#: ../../library/logging.rst:1405 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1400 +#: ../../library/logging.rst:1405 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -2050,33 +2057,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1409 +#: ../../library/logging.rst:1414 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1409 +#: ../../library/logging.rst:1414 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1415 +#: ../../library/logging.rst:1420 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1415 +#: ../../library/logging.rst:1420 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1425 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1425 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -2085,39 +2092,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1431 +#: ../../library/logging.rst:1436 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1434 +#: ../../library/logging.rst:1439 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1440 +#: ../../library/logging.rst:1445 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1443 +#: ../../library/logging.rst:1448 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1448 +#: ../../library/logging.rst:1453 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1452 +#: ../../library/logging.rst:1457 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1459 +#: ../../library/logging.rst:1464 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`!__init__` such that only a name " @@ -2129,32 +2136,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1470 +#: ../../library/logging.rst:1475 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1472 +#: ../../library/logging.rst:1477 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1474 +#: ../../library/logging.rst:1479 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1479 +#: ../../library/logging.rst:1484 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1481 +#: ../../library/logging.rst:1486 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1483 +#: ../../library/logging.rst:1488 msgid "The logger name." msgstr "" @@ -2162,7 +2169,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1484 +#: ../../library/logging.rst:1489 msgid "The logging level (numeric)." msgstr "" @@ -2170,7 +2177,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1485 +#: ../../library/logging.rst:1490 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -2178,19 +2185,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1491 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1487 +#: ../../library/logging.rst:1492 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1488 +#: ../../library/logging.rst:1493 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1489 +#: ../../library/logging.rst:1494 msgid "An exception tuple, or ``None``." msgstr "" @@ -2198,7 +2205,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1490 +#: ../../library/logging.rst:1495 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2206,7 +2213,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1492 +#: ../../library/logging.rst:1497 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2216,15 +2223,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1494 +#: ../../library/logging.rst:1499 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1498 +#: ../../library/logging.rst:1503 msgid "Module-Level Attributes" msgstr "模組層級屬性" -#: ../../library/logging.rst:1502 +#: ../../library/logging.rst:1507 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -2235,15 +2242,15 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1514 +#: ../../library/logging.rst:1519 msgid "Used to see if exceptions during handling should be propagated." msgstr "" -#: ../../library/logging.rst:1516 +#: ../../library/logging.rst:1521 msgid "Default: ``True``." msgstr "" -#: ../../library/logging.rst:1518 +#: ../../library/logging.rst:1523 msgid "" "If :data:`raiseExceptions` is ``False``, exceptions get silently ignored. " "This is what is mostly wanted for a logging system - most users will not " @@ -2251,22 +2258,22 @@ msgid "" "application errors." msgstr "" -#: ../../library/logging.rst:1525 +#: ../../library/logging.rst:1530 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1527 +#: ../../library/logging.rst:1532 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1532 +#: ../../library/logging.rst:1537 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1535 +#: ../../library/logging.rst:1540 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2275,46 +2282,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1540 +#: ../../library/logging.rst:1545 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1547 +#: ../../library/logging.rst:1552 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.rst:1548 +#: ../../library/logging.rst:1553 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1550 +#: ../../library/logging.rst:1555 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../library/logging.rst:1551 +#: ../../library/logging.rst:1556 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1553 +#: ../../library/logging.rst:1558 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1554 +#: ../../library/logging.rst:1559 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1557 +#: ../../library/logging.rst:1562 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1558 +#: ../../library/logging.rst:1563 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " From 50088983e8860e2683f8018cdac0b88f8f042c60 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Nov 2025 00:17:30 +0000 Subject: [PATCH 06/12] sync with cpython 631ba340 --- library/html.parser.po | 204 ++++++++++++++++++++++------------------- reference/grammar.po | 109 +++++++++++----------- 2 files changed, 165 insertions(+), 148 deletions(-) diff --git a/library/html.parser.po b/library/html.parser.po index 999f46dd86..0ffa62b1dc 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-08 00:15+0000\n" +"POT-Creation-Date: 2025-11-01 00:16+0000\n" "PO-Revision-Date: 2023-05-04 22:54+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,26 +41,34 @@ msgid "Create a parser instance able to parse invalid markup." msgstr "建立一個能夠剖析無效標記的剖析器實例。" #: ../../library/html.parser.rst:22 +#, fuzzy msgid "" -"If *convert_charrefs* is ``True`` (the default), all character references " -"(except the ones in ``script``/``style`` elements) are automatically " -"converted to the corresponding Unicode characters." +"If *convert_charrefs* is true (the default), all character references " +"(except the ones in elements like ``script`` and ``style``) are " +"automatically converted to the corresponding Unicode characters." msgstr "" "如果 *convert_charrefs* 為 ``True`` (預設值),所有字元參照 (reference)" "( ``script``/``style`` 元素中的參照除外)將自動轉換為相應的 Unicode 字元。" #: ../../library/html.parser.rst:26 msgid "" +"If *scripting* is false (the default), the content of the ``noscript`` " +"element is parsed normally; if it's true, it's returned as is without being " +"parsed." +msgstr "" + +#: ../../library/html.parser.rst:30 +msgid "" "An :class:`.HTMLParser` instance is fed HTML data and calls handler methods " "when start tags, end tags, text, comments, and other markup elements are " "encountered. The user should subclass :class:`.HTMLParser` and override its " "methods to implement the desired behavior." msgstr "" ":class:`.HTMLParser` 實例被提供 HTML 資料,並在遇到開始標籤、結束標籤、文本、" -"註解和其他標記元素時呼叫處理程式 (handler) 方法。使用者應該繼" -"承 :class:`.HTMLParser` 並覆蓋其方法以實作所需的行為。" +"註解和其他標記元素時呼叫處理程式 (handler) 方法。使用者應該繼承 :class:`." +"HTMLParser` 並覆蓋其方法以實作所需的行為。" -#: ../../library/html.parser.rst:31 +#: ../../library/html.parser.rst:35 msgid "" "This parser does not check that end tags match start tags or call the end-" "tag handler for elements which are closed implicitly by closing an outer " @@ -69,28 +77,32 @@ msgstr "" "此剖析器不檢查結束標籤是否與開始標籤匹配,也不會為透過結束外部元素來隱晦地被" "結束的元素呼叫結束標籤處理程式。" -#: ../../library/html.parser.rst:34 +#: ../../library/html.parser.rst:38 msgid "*convert_charrefs* keyword argument added." msgstr "新增關鍵字引數 *convert_charrefs*。" -#: ../../library/html.parser.rst:37 +#: ../../library/html.parser.rst:41 msgid "The default value for argument *convert_charrefs* is now ``True``." msgstr "引數 *convert_charrefs* 的預設值現在是 ``True``。" -#: ../../library/html.parser.rst:42 +#: ../../library/html.parser.rst:44 +msgid "Added the *scripting* parameter." +msgstr "" + +#: ../../library/html.parser.rst:49 msgid "Example HTML Parser Application" msgstr "HTML 剖析器應用程式範例" -#: ../../library/html.parser.rst:44 +#: ../../library/html.parser.rst:51 msgid "" -"As a basic example, below is a simple HTML parser that uses " -"the :class:`HTMLParser` class to print out start tags, end tags, and data as " -"they are encountered:" +"As a basic example, below is a simple HTML parser that uses the :class:" +"`HTMLParser` class to print out start tags, end tags, and data as they are " +"encountered:" msgstr "" "以下的基礎範例是一個簡單的 HTML 剖析器,它使用 :class:`HTMLParser` 類別,當遇" "到開始標籤、結束標籤和資料時將它們印出:" -#: ../../library/html.parser.rst:48 +#: ../../library/html.parser.rst:55 msgid "" "from html.parser import HTMLParser\n" "\n" @@ -124,11 +136,11 @@ msgstr "" "parser.feed('Test'\n" " '

Parse me!

')" -#: ../../library/html.parser.rst:66 +#: ../../library/html.parser.rst:73 msgid "The output will then be:" msgstr "輸出將是:" -#: ../../library/html.parser.rst:68 +#: ../../library/html.parser.rst:75 msgid "" "Encountered a start tag: html\n" "Encountered a start tag: head\n" @@ -156,24 +168,24 @@ msgstr "" "Encountered an end tag : body\n" "Encountered an end tag : html" -#: ../../library/html.parser.rst:85 +#: ../../library/html.parser.rst:92 msgid ":class:`.HTMLParser` Methods" msgstr ":class:`.HTMLParser` 方法" -#: ../../library/html.parser.rst:87 +#: ../../library/html.parser.rst:94 msgid ":class:`HTMLParser` instances have the following methods:" msgstr ":class:`HTMLParser` 實例具有以下方法:" -#: ../../library/html.parser.rst:92 +#: ../../library/html.parser.rst:99 msgid "" "Feed some text to the parser. It is processed insofar as it consists of " -"complete elements; incomplete data is buffered until more data is fed " -"or :meth:`close` is called. *data* must be :class:`str`." +"complete elements; incomplete data is buffered until more data is fed or :" +"meth:`close` is called. *data* must be :class:`str`." msgstr "" "向剖析器提供一些文本。只要它由完整的元素組成,它就會被處理;不完整的資料會被" "緩衝,直到輸入更多資料或呼叫 :meth:`close`。 *data* 必須是 :class:`str`。" -#: ../../library/html.parser.rst:99 +#: ../../library/html.parser.rst:106 msgid "" "Force processing of all buffered data as if it were followed by an end-of-" "file mark. This method may be redefined by a derived class to define " @@ -181,20 +193,20 @@ msgid "" "should always call the :class:`HTMLParser` base class method :meth:`close`." msgstr "" "強制處理所有緩衝資料,如同它後面跟有文件結束標籤一樣。此方法可能有被衍生類別" -"重新定義,以在輸入末尾定義額外的處理,但重新定義的版本仍應要呼" -"叫 :class:`HTMLParser` 基底類別方法 :meth:`close`。" +"重新定義,以在輸入末尾定義額外的處理,但重新定義的版本仍應要呼叫 :class:" +"`HTMLParser` 基底類別方法 :meth:`close`。" -#: ../../library/html.parser.rst:107 +#: ../../library/html.parser.rst:114 msgid "" "Reset the instance. Loses all unprocessed data. This is called implicitly " "at instantiation time." msgstr "重置實例。丟棄所有未處理的資料。這在實例化時被會隱晦地呼叫。" -#: ../../library/html.parser.rst:113 +#: ../../library/html.parser.rst:120 msgid "Return current line number and offset." msgstr "回傳目前列號 (line number) 和偏移量 (offset)。" -#: ../../library/html.parser.rst:118 +#: ../../library/html.parser.rst:125 msgid "" "Return the text of the most recently opened start tag. This should not " "normally be needed for structured processing, but may be useful in dealing " @@ -205,23 +217,23 @@ msgstr "" "「已部署」的 HTML 或以最少的更改重新生成輸入(可以保留屬性之間的空白等)時可" "能很有用。" -#: ../../library/html.parser.rst:124 +#: ../../library/html.parser.rst:131 msgid "" "The following methods are called when data or markup elements are " "encountered and they are meant to be overridden in a subclass. The base " -"class implementations do nothing (except " -"for :meth:`~HTMLParser.handle_startendtag`):" +"class implementations do nothing (except for :meth:`~HTMLParser." +"handle_startendtag`):" msgstr "" "當遇到資料或標記元素時將呼叫以下方法,並且它們應在子類別中被覆蓋。基底類別實" "作什麼都不做(除了 :meth:`~HTMLParser.handle_startendtag`):" -#: ../../library/html.parser.rst:131 +#: ../../library/html.parser.rst:138 msgid "" "This method is called to handle the start tag of an element (e.g. ``
``)." msgstr "呼叫此方法來處理元素的開始標籤(例如 ``
``)。" -#: ../../library/html.parser.rst:133 +#: ../../library/html.parser.rst:140 msgid "" "The *tag* argument is the name of the tag converted to lower case. The " "*attrs* argument is a list of ``(name, value)`` pairs containing the " @@ -233,81 +245,84 @@ msgstr "" "列表,包含在標籤的 ``<>`` 括號內找到的屬性。 *name* 將被轉成小寫,*value* 中" "的引號會被刪除,字元和實體參照也會被替換。" -#: ../../library/html.parser.rst:139 +#: ../../library/html.parser.rst:146 msgid "" "For instance, for the tag ````, this method " -"would be called as ``handle_starttag('a', [('href', 'https://" -"www.cwi.nl/')])``." +"would be called as ``handle_starttag('a', [('href', 'https://www.cwi." +"nl/')])``." msgstr "" "例如,對於標籤 ````,這個方法會以 " "``handle_starttag('a', [('href', 'https://www.cwi.nl/')])`` 的形式被呼叫。" -#: ../../library/html.parser.rst:142 +#: ../../library/html.parser.rst:149 msgid "" "All entity references from :mod:`html.entities` are replaced in the " "attribute values." msgstr "在屬性值中來自 :mod:`html.entities` 的所有實體參照都會被替換。" -#: ../../library/html.parser.rst:148 +#: ../../library/html.parser.rst:155 msgid "" "This method is called to handle the end tag of an element (e.g. ``
``)." msgstr "呼叫此方法來處理元素的結束標籤(例如 ``
``)。" -#: ../../library/html.parser.rst:150 +#: ../../library/html.parser.rst:157 msgid "The *tag* argument is the name of the tag converted to lower case." msgstr "*tag* 引數是轉換為小寫的標籤名稱。" -#: ../../library/html.parser.rst:155 +#: ../../library/html.parser.rst:162 msgid "" "Similar to :meth:`handle_starttag`, but called when the parser encounters an " "XHTML-style empty tag (````). This method may be overridden by " "subclasses which require this particular lexical information; the default " -"implementation simply calls :meth:`handle_starttag` " -"and :meth:`handle_endtag`." +"implementation simply calls :meth:`handle_starttag` and :meth:" +"`handle_endtag`." msgstr "" "與 :meth:`handle_starttag` 類似,但在剖析器遇到 XHTML 樣式的空標籤 " "(````) 時呼叫。這個方法可能被需要這個特定詞彙資訊 (lexical " -"information) 的子類別覆蓋;預設實作只是呼叫 :meth:`handle_starttag` " -"和 :meth:`handle_endtag`。" +"information) 的子類別覆蓋;預設實作只是呼叫 :meth:`handle_starttag` 和 :meth:" +"`handle_endtag`。" -#: ../../library/html.parser.rst:163 +#: ../../library/html.parser.rst:170 +#, fuzzy msgid "" "This method is called to process arbitrary data (e.g. text nodes and the " -"content of ```` and ````)." +"content of elements like ``script`` and ``style``)." msgstr "" "呼叫此方法來處理任意資料(例如文本節點與 ```` 和 " "```` 的內容)。" -#: ../../library/html.parser.rst:169 +#: ../../library/html.parser.rst:176 +#, fuzzy msgid "" "This method is called to process a named character reference of the form " "``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g. " -"``'gt'``). This method is never called if *convert_charrefs* is ``True``." +"``'gt'``). This method is only called if *convert_charrefs* is false." msgstr "" "呼叫此方法來處理形式為 ``&name;`` (例如 ``>``)的附名字元參照,其中 " "*name* 是一般實體參照(例如 ``'gt'``)。如果 *convert_charrefs* 為 ``True``," "則永遠不會呼叫此方法。" -#: ../../library/html.parser.rst:177 +#: ../../library/html.parser.rst:184 +#, fuzzy msgid "" "This method is called to process decimal and hexadecimal numeric character " "references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example, " "the decimal equivalent for ``>`` is ``>``, whereas the hexadecimal is " -"``>``; in this case the method will receive ``'62'`` or ``'x3E'``. " -"This method is never called if *convert_charrefs* is ``True``." +"``>``; in this case the method will receive ``'62'`` or ``'x3E'``. This " +"method is only called if *convert_charrefs* is false." msgstr "" "呼叫此方法來處理 :samp:`&#{NNN};` 和 :samp:`&#x{NNN};` 形式的十進位和十六進位" -"數字字元參照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 " -"``>``;在這種情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 " +"數字字元參照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>" +"``;在這種情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 " "*convert_charrefs* 為 ``True``,則永遠不會呼叫此方法。" -#: ../../library/html.parser.rst:186 +#: ../../library/html.parser.rst:193 msgid "" "This method is called when a comment is encountered (e.g. ````)。" -#: ../../library/html.parser.rst:188 +#: ../../library/html.parser.rst:195 msgid "" "For example, the comment ```` will cause this method to be " "called with the argument ``' comment '``." @@ -315,7 +330,7 @@ msgstr "" "舉例來說,註解 ```` 會使得此方法被以引數 ``' comment '`` 來呼" "叫。" -#: ../../library/html.parser.rst:191 +#: ../../library/html.parser.rst:198 msgid "" "The content of Internet Explorer conditional comments (condcoms) will also " "be sent to this method, so, for ```` 為例," "這個方法將會收到 ``'[if IE 9]>IE9-specific content``)." @@ -334,7 +349,7 @@ msgstr "" "呼叫此方法來處理 HTML 文件類型聲明 (doctype declaration)(例如 ````)。" -#: ../../library/html.parser.rst:201 +#: ../../library/html.parser.rst:208 msgid "" "The *decl* parameter will be the entire contents of the declaration inside " "the ```` markup (e.g. ``'DOCTYPE html'``)." @@ -342,7 +357,7 @@ msgstr "" "*decl* 參數將是 ```` 標記內聲明部分的全部內容(例如 ``'DOCTYPE " "html'``)。" -#: ../../library/html.parser.rst:207 +#: ../../library/html.parser.rst:214 msgid "" "Method called when a processing instruction is encountered. The *data* " "parameter will contain the entire processing instruction. For example, for " @@ -355,7 +370,7 @@ msgstr "" "``handle_pi(\"proc color='red'\")`` 形式被呼叫。它旨在被衍生類別覆蓋;基底類" "別實作中什麼都不做。" -#: ../../library/html.parser.rst:215 +#: ../../library/html.parser.rst:222 msgid "" "The :class:`HTMLParser` class uses the SGML syntactic rules for processing " "instructions. An XHTML processing instruction using the trailing ``'?'`` " @@ -364,12 +379,12 @@ msgstr "" ":class:`HTMLParser` 類別使用 SGML 語法規則來處理指示。使用有 ``?`` 跟隨在後面" "的 XHTML 處理指示將導致 ``?`` 被包含在 *data* 中。" -#: ../../library/html.parser.rst:222 +#: ../../library/html.parser.rst:229 msgid "" "This method is called when an unrecognized declaration is read by the parser." msgstr "當剖析器讀取無法識別的聲明時會呼叫此方法。" -#: ../../library/html.parser.rst:224 +#: ../../library/html.parser.rst:231 msgid "" "The *data* parameter will be the entire contents of the declaration inside " "the ```` markup. It is sometimes useful to be overridden by a " @@ -378,17 +393,17 @@ msgstr "" "*data* 參數將是 ```` 標記內聲明的全部內容。有時被衍生類別被覆蓋會是好" "用的。在基底類別實作中什麼都不做。" -#: ../../library/html.parser.rst:232 +#: ../../library/html.parser.rst:239 msgid "Examples" msgstr "範例" -#: ../../library/html.parser.rst:234 +#: ../../library/html.parser.rst:241 msgid "" "The following class implements a parser that will be used to illustrate more " "examples:" msgstr "以下類別實作了一個剖析器,將用於解說更多範例:" -#: ../../library/html.parser.rst:237 +#: ../../library/html.parser.rst:244 msgid "" "from html.parser import HTMLParser\n" "from html.entities import name2codepoint\n" @@ -458,27 +473,27 @@ msgstr "" "\n" "parser = MyHTMLParser()" -#: ../../library/html.parser.rst:273 +#: ../../library/html.parser.rst:280 msgid "Parsing a doctype:" msgstr "剖析文件類型:" -#: ../../library/html.parser.rst:275 +#: ../../library/html.parser.rst:282 msgid "" ">>> parser.feed('')\n" -"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://" -"www.w3.org/TR/html4/strict.dtd\"" +"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3." +"org/TR/html4/strict.dtd\"" msgstr "" ">>> parser.feed('')\n" -"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://" -"www.w3.org/TR/html4/strict.dtd\"" +"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3." +"org/TR/html4/strict.dtd\"" -#: ../../library/html.parser.rst:281 +#: ../../library/html.parser.rst:288 msgid "Parsing an element with a few attributes and a title:" msgstr "剖析一個具有一些屬性和標題的元素:" -#: ../../library/html.parser.rst:283 +#: ../../library/html.parser.rst:290 msgid "" ">>> parser.feed('\"The')\n" "Start tag: img\n" @@ -500,13 +515,15 @@ msgstr "" "Data : Python\n" "End tag : h1" -#: ../../library/html.parser.rst:295 +#: ../../library/html.parser.rst:302 +#, fuzzy msgid "" -"The content of ``script`` and ``style`` elements is returned as is, without " -"further parsing:" +"The content of elements like ``script`` and ``style`` is returned as is, " +"without further parsing:" msgstr "``script`` 和 ``style`` 元素的內容按原樣回傳,無需進一步剖析:" -#: ../../library/html.parser.rst:298 +#: ../../library/html.parser.rst:305 +#, fuzzy msgid "" ">>> parser.feed('`` 的內容)。" +"呼叫此方法來處理任意資料(例如文本節點與像是 ``script`` 和 ``style`` 元素的內容)。" #: ../../library/html.parser.rst:176 -#, fuzzy msgid "" "This method is called to process a named character reference of the form " "``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g. " "``'gt'``). This method is only called if *convert_charrefs* is false." msgstr "" "呼叫此方法來處理形式為 ``&name;`` (例如 ``>``)的附名字元參照,其中 " -"*name* 是一般實體參照(例如 ``'gt'``)。如果 *convert_charrefs* 為 ``True``," -"則永遠不會呼叫此方法。" +"*name* 是一般實體參照(例如 ``'gt'``)。此方法只有在 *convert_charrefs* 為 " +"false 時才會被呼叫。" #: ../../library/html.parser.rst:184 -#, fuzzy msgid "" "This method is called to process decimal and hexadecimal numeric character " "references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example, " @@ -313,8 +308,8 @@ msgid "" msgstr "" "呼叫此方法來處理 :samp:`&#{NNN};` 和 :samp:`&#x{NNN};` 形式的十進位和十六進位" "數字字元參照。例如,``>`` 的十進位等效為 ``>``,而十六進位為 ``>" -"``;在這種情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。如果 " -"*convert_charrefs* 為 ``True``,則永遠不會呼叫此方法。" +"``;在這種情況下,該方法將收到 ``'62'`` 或 ``'x3E'``。此方法只有在 *convert_charrefs* 為 " +"false 時才會被呼叫。" #: ../../library/html.parser.rst:193 msgid "" @@ -516,14 +511,12 @@ msgstr "" "End tag : h1" #: ../../library/html.parser.rst:302 -#, fuzzy msgid "" "The content of elements like ``script`` and ``style`` is returned as is, " "without further parsing:" -msgstr "``script`` 和 ``style`` 元素的內容按原樣回傳,無需進一步剖析:" +msgstr "像是 ``script`` 和 ``style`` 這類元素的內容將按原樣回傳,無需進一步的剖析:" #: ../../library/html.parser.rst:305 -#, fuzzy msgid "" ">>> parser.feed('