From 530a491f5b733e36abaac8942c286b99edd8bcd6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 1 Dec 2022 00:22:30 +0000 Subject: [PATCH 01/11] sync with cpython 0076ca48 --- library/re.po | 113 +++++++++++++++++++++++++-------------------- library/weakref.po | 96 ++++++++++++++++++++------------------ 2 files changed, 113 insertions(+), 96 deletions(-) diff --git a/library/re.po b/library/re.po index bbd84806644..73a0cb845a0 100644 --- a/library/re.po +++ b/library/re.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-04 00:20+0000\n" +"POT-Creation-Date: 2022-12-01 00:20+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -175,8 +175,8 @@ msgstr "``$``" msgid "" "Matches the end of the string or just before the newline at the end of the " "string, and in :const:`MULTILINE` mode also matches before a newline. " -"``foo`` matches both 'foo' and 'foobar', while the regular expression ``foo" -"$`` matches only 'foo'. More interestingly, searching for ``foo.$`` in " +"``foo`` matches both 'foo' and 'foobar', while the regular expression " +"``foo$`` matches only 'foo'. More interestingly, searching for ``foo.$`` in " "``'foo1\\nfoo2\\n'`` matches 'foo2' normally, but 'foo1' in :const:" "`MULTILINE` mode; searching for a single ``$`` in ``'foo\\n'`` will find two " "(empty) matches: one just before the newline, and one at the end of the " @@ -806,10 +806,10 @@ msgstr "``\\s``" #: ../../library/re.rst:571 msgid "" -"Matches Unicode whitespace characters (which includes ``[ \\t\\n\\r\\f" -"\\v]``, and also many other characters, for example the non-breaking spaces " -"mandated by typography rules in many languages). If the :const:`ASCII` flag " -"is used, only ``[ \\t\\n\\r\\f\\v]`` is matched." +"Matches Unicode whitespace characters (which includes " +"``[ \\t\\n\\r\\f\\v]``, and also many other characters, for example the non-" +"breaking spaces mandated by typography rules in many languages). If the :" +"const:`ASCII` flag is used, only ``[ \\t\\n\\r\\f\\v]`` is matched." msgstr "" #: ../../library/re.rst:578 @@ -943,9 +943,9 @@ msgstr "" #: ../../library/re.rst:689 msgid "" -"Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and ``" -"\\S`` perform ASCII-only matching instead of full Unicode matching. This is " -"only meaningful for Unicode patterns, and is ignored for byte patterns. " +"Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " +"``\\S`` perform ASCII-only matching instead of full Unicode matching. This " +"is only meaningful for Unicode patterns, and is ignored for byte patterns. " "Corresponds to the inline flag ``(?a)``." msgstr "" @@ -978,9 +978,9 @@ msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " "letters and 4 additional non-ASCII letters: 'İ' (U+0130, Latin capital " -"letter I with dot above), 'ı' (U+0131, Latin small letter dotless i), 'ſ' (U" -"+017F, Latin small letter long s) and 'K' (U+212A, Kelvin sign). If the :" -"const:`ASCII` flag is used, only letters 'a' to 'z' and 'A' to 'Z' are " +"letter I with dot above), 'ı' (U+0131, Latin small letter dotless i), " +"'ſ' (U+017F, Latin small letter long s) and 'K' (U+212A, Kelvin sign). If " +"the :const:`ASCII` flag is used, only letters 'a' to 'z' and 'A' to 'Z' are " "matched." msgstr "" @@ -1210,11 +1210,11 @@ msgid "" "occurrences of *pattern* in *string* by the replacement *repl*. If the " "pattern isn't found, *string* is returned unchanged. *repl* can be a string " "or a function; if it is a string, any backslash escapes in it are " -"processed. That is, ``\\n`` is converted to a single newline character, ``" -"\\r`` is converted to a carriage return, and so forth. Unknown escapes of " +"processed. That is, ``\\n`` is converted to a single newline character, " +"``\\r`` is converted to a carriage return, and so forth. Unknown escapes of " "ASCII letters are reserved for future use and treated as errors. Other " -"unknown escapes such as ``\\&`` are left alone. Backreferences, such as ``" -"\\6``, are replaced with the substring matched by group 6 in the pattern. " +"unknown escapes such as ``\\&`` are left alone. Backreferences, such as " +"``\\6``, are replaced with the substring matched by group 6 in the pattern. " "For example::" msgstr "" @@ -1242,11 +1242,11 @@ msgstr "" msgid "" "In string-type *repl* arguments, in addition to the character escapes and " "backreferences described above, ``\\g`` will use the substring matched " -"by the group named ``name``, as defined by the ``(?P...)`` syntax. ``" -"\\g`` uses the corresponding group number; ``\\g<2>`` is therefore " -"equivalent to ``\\2``, but isn't ambiguous in a replacement such as ``" -"\\g<2>0``. ``\\20`` would be interpreted as a reference to group 20, not a " -"reference to group 2 followed by the literal character ``'0'``. The " +"by the group named ``name``, as defined by the ``(?P...)`` syntax. " +"``\\g`` uses the corresponding group number; ``\\g<2>`` is therefore " +"equivalent to ``\\2``, but isn't ambiguous in a replacement such as " +"``\\g<2>0``. ``\\20`` would be interpreted as a reference to group 20, not " +"a reference to group 2 followed by the literal character ``'0'``. The " "backreference ``\\g<0>`` substitutes in the entire substring matched by the " "RE." msgstr "" @@ -1492,8 +1492,8 @@ msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " "as ``\\n`` are converted to the appropriate characters, and numeric " -"backreferences (``\\1``, ``\\2``) and named backreferences (``\\g<1>``, ``" -"\\g``) are replaced by the contents of the corresponding group." +"backreferences (``\\1``, ``\\2``) and named backreferences (``\\g<1>``, " +"``\\g``) are replaced by the contents of the corresponding group." msgstr "" #: ../../library/re.rst:1269 @@ -1548,7 +1548,7 @@ msgid "" "groups that did not participate in the match; it defaults to ``None``." msgstr "" -#: ../../library/re.rst:1348 ../../library/re.rst:1570 +#: ../../library/re.rst:1348 ../../library/re.rst:1573 msgid "For example::" msgstr "" "舉例來說:\n" @@ -1788,19 +1788,30 @@ msgstr "" #: ../../library/re.rst:1565 msgid "" -"Python offers two different primitive operations based on regular " -"expressions: :func:`re.match` checks for a match only at the beginning of " -"the string, while :func:`re.search` checks for a match anywhere in the " -"string (this is what Perl does by default)." +"Python offers different primitive operations based on regular expressions:" msgstr "" -#: ../../library/re.rst:1576 +#: ../../library/re.rst:1567 +msgid ":func:`re.match` checks for a match only at the beginning of the string" +msgstr "" + +#: ../../library/re.rst:1568 +msgid "" +":func:`re.search` checks for a match anywhere in the string (this is what " +"Perl does by default)" +msgstr "" + +#: ../../library/re.rst:1570 +msgid ":func:`re.fullmatch` checks for entire string to be a match" +msgstr "" + +#: ../../library/re.rst:1582 msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" -#: ../../library/re.rst:1584 +#: ../../library/re.rst:1590 msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " @@ -1808,11 +1819,11 @@ msgid "" "line. ::" msgstr "" -#: ../../library/re.rst:1594 +#: ../../library/re.rst:1600 msgid "Making a Phonebook" msgstr "" -#: ../../library/re.rst:1596 +#: ../../library/re.rst:1602 msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " @@ -1820,37 +1831,37 @@ msgid "" "following example that creates a phonebook." msgstr "" -#: ../../library/re.rst:1601 +#: ../../library/re.rst:1607 msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" msgstr "" -#: ../../library/re.rst:1614 +#: ../../library/re.rst:1620 msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" -#: ../../library/re.rst:1627 +#: ../../library/re.rst:1633 msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" -#: ../../library/re.rst:1640 +#: ../../library/re.rst:1646 msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" -#: ../../library/re.rst:1655 +#: ../../library/re.rst:1661 msgid "Text Munging" msgstr "" -#: ../../library/re.rst:1657 +#: ../../library/re.rst:1663 msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " @@ -1858,11 +1869,11 @@ msgid "" "each word of a sentence except for the first and last characters::" msgstr "" -#: ../../library/re.rst:1674 +#: ../../library/re.rst:1680 msgid "Finding all Adverbs" msgstr "" -#: ../../library/re.rst:1676 +#: ../../library/re.rst:1682 msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " @@ -1870,11 +1881,11 @@ msgid "" "manner::" msgstr "" -#: ../../library/re.rst:1687 +#: ../../library/re.rst:1693 msgid "Finding all Adverbs and their Positions" msgstr "" -#: ../../library/re.rst:1689 +#: ../../library/re.rst:1695 msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :ref:`match objects " @@ -1883,11 +1894,11 @@ msgid "" "text, they would use :func:`finditer` in the following manner::" msgstr "" -#: ../../library/re.rst:1703 +#: ../../library/re.rst:1709 msgid "Raw String Notation" msgstr "" -#: ../../library/re.rst:1705 +#: ../../library/re.rst:1711 msgid "" "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without " "it, every backslash (``'\\'``) in a regular expression would have to be " @@ -1895,7 +1906,7 @@ msgid "" "lines of code are functionally identical::" msgstr "" -#: ../../library/re.rst:1715 +#: ../../library/re.rst:1721 msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " @@ -1903,29 +1914,29 @@ msgid "" "following lines of code functionally identical::" msgstr "" -#: ../../library/re.rst:1727 +#: ../../library/re.rst:1733 msgid "Writing a Tokenizer" msgstr "" -#: ../../library/re.rst:1729 +#: ../../library/re.rst:1735 msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" -#: ../../library/re.rst:1733 +#: ../../library/re.rst:1739 msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" -#: ../../library/re.rst:1789 +#: ../../library/re.rst:1795 msgid "The tokenizer produces the following output::" msgstr "" -#: ../../library/re.rst:1812 +#: ../../library/re.rst:1818 msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " diff --git a/library/weakref.po b/library/weakref.po index 23d7f148496..bb9d3e9b8b2 100644 --- a/library/weakref.po +++ b/library/weakref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-12-01 00:20+0000\n" "PO-Revision-Date: 2018-05-23 16:15+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -203,7 +203,7 @@ msgid "" "have a type of either ``ProxyType`` or ``CallableProxyType``, depending on " "whether *object* is callable. Proxy objects are not :term:`hashable` " "regardless of the referent; this avoids a number of problems related to " -"their fundamentally mutable nature, and prevent their use as dictionary " +"their fundamentally mutable nature, and prevents their use as dictionary " "keys. *callback* is the same as the parameter of the same name to the :func:" "`ref` function." msgstr "" @@ -295,7 +295,13 @@ msgid "" "method until either the object or the original function dies::" msgstr "" -#: ../../library/weakref.rst:245 +#: ../../library/weakref.rst:241 +msgid "" +"*callback* is the same as the parameter of the same name to the :func:`ref` " +"function." +msgstr "" + +#: ../../library/weakref.rst:247 msgid "" "Return a callable finalizer object which will be called when *obj* is " "garbage collected. Unlike an ordinary weak reference, a finalizer will " @@ -303,7 +309,7 @@ msgid "" "lifecycle management." msgstr "" -#: ../../library/weakref.rst:250 +#: ../../library/weakref.rst:252 msgid "" "A finalizer is considered *alive* until it is called (either explicitly or " "at garbage collection), and after that it is *dead*. Calling a live " @@ -311,7 +317,7 @@ msgid "" "calling a dead finalizer returns :const:`None`." msgstr "" -#: ../../library/weakref.rst:255 +#: ../../library/weakref.rst:257 msgid "" "Exceptions raised by finalizer callbacks during garbage collection will be " "shown on the standard error output, but cannot be propagated. They are " @@ -319,50 +325,50 @@ msgid "" "`__del__` method or a weak reference's callback." msgstr "" -#: ../../library/weakref.rst:261 +#: ../../library/weakref.rst:263 msgid "" "When the program exits, each remaining live finalizer is called unless its :" "attr:`atexit` attribute has been set to false. They are called in reverse " "order of creation." msgstr "" -#: ../../library/weakref.rst:265 +#: ../../library/weakref.rst:267 msgid "" "A finalizer will never invoke its callback during the later part of the :" "term:`interpreter shutdown` when module globals are liable to have been " "replaced by :const:`None`." msgstr "" -#: ../../library/weakref.rst:271 +#: ../../library/weakref.rst:273 msgid "" "If *self* is alive then mark it as dead and return the result of calling " "``func(*args, **kwargs)``. If *self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:277 +#: ../../library/weakref.rst:279 msgid "" "If *self* is alive then mark it as dead and return the tuple ``(obj, func, " "args, kwargs)``. If *self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:283 +#: ../../library/weakref.rst:285 msgid "" "If *self* is alive then return the tuple ``(obj, func, args, kwargs)``. If " "*self* is dead then return :const:`None`." msgstr "" -#: ../../library/weakref.rst:288 +#: ../../library/weakref.rst:290 msgid "Property which is true if the finalizer is alive, false otherwise." msgstr "" -#: ../../library/weakref.rst:292 +#: ../../library/weakref.rst:294 msgid "" "A writable boolean property which by default is true. When the program " "exits, it calls all remaining live finalizers for which :attr:`.atexit` is " "true. They are called in reverse order of creation." msgstr "" -#: ../../library/weakref.rst:299 +#: ../../library/weakref.rst:301 msgid "" "It is important to ensure that *func*, *args* and *kwargs* do not own any " "references to *obj*, either directly or indirectly, since otherwise *obj* " @@ -370,60 +376,60 @@ msgid "" "bound method of *obj*." msgstr "" -#: ../../library/weakref.rst:309 +#: ../../library/weakref.rst:311 msgid "The type object for weak references objects." msgstr "" -#: ../../library/weakref.rst:314 +#: ../../library/weakref.rst:316 msgid "The type object for proxies of objects which are not callable." msgstr "" -#: ../../library/weakref.rst:319 +#: ../../library/weakref.rst:321 msgid "The type object for proxies of callable objects." msgstr "" -#: ../../library/weakref.rst:324 +#: ../../library/weakref.rst:326 msgid "" "Sequence containing all the type objects for proxies. This can make it " "simpler to test if an object is a proxy without being dependent on naming " "both proxy types." msgstr "" -#: ../../library/weakref.rst:332 +#: ../../library/weakref.rst:334 msgid ":pep:`205` - Weak References" msgstr "" -#: ../../library/weakref.rst:332 +#: ../../library/weakref.rst:334 msgid "" "The proposal and rationale for this feature, including links to earlier " "implementations and information about similar features in other languages." msgstr "" -#: ../../library/weakref.rst:339 +#: ../../library/weakref.rst:341 msgid "Weak Reference Objects" msgstr "" -#: ../../library/weakref.rst:341 +#: ../../library/weakref.rst:343 msgid "" "Weak reference objects have no methods and no attributes besides :attr:`ref." "__callback__`. A weak reference object allows the referent to be obtained, " "if it still exists, by calling it:" msgstr "" -#: ../../library/weakref.rst:355 +#: ../../library/weakref.rst:357 msgid "" "If the referent no longer exists, calling the reference object returns :" "const:`None`:" msgstr "" -#: ../../library/weakref.rst:362 +#: ../../library/weakref.rst:364 msgid "" "Testing that a weak reference object is still live should be done using the " "expression ``ref() is not None``. Normally, application code that needs to " "use a reference object should follow this pattern::" msgstr "" -#: ../../library/weakref.rst:375 +#: ../../library/weakref.rst:377 msgid "" "Using a separate test for \"liveness\" creates race conditions in threaded " "applications; another thread can cause a weak reference to become " @@ -431,7 +437,7 @@ msgid "" "safe in threaded applications as well as single-threaded applications." msgstr "" -#: ../../library/weakref.rst:380 +#: ../../library/weakref.rst:382 msgid "" "Specialized versions of :class:`ref` objects can be created through " "subclassing. This is used in the implementation of the :class:" @@ -441,18 +447,18 @@ msgid "" "to retrieve the referent." msgstr "" -#: ../../library/weakref.rst:386 +#: ../../library/weakref.rst:388 msgid "" "This example shows how a subclass of :class:`ref` can be used to store " "additional information about an object and affect the value that's returned " "when the referent is accessed::" msgstr "" -#: ../../library/weakref.rst:413 +#: ../../library/weakref.rst:415 msgid "Example" msgstr "範例" -#: ../../library/weakref.rst:415 +#: ../../library/weakref.rst:417 msgid "" "This simple example shows how an application can use object IDs to retrieve " "objects that it has seen before. The IDs of the objects can then be used in " @@ -460,67 +466,67 @@ msgid "" "objects can still be retrieved by ID if they do." msgstr "" -#: ../../library/weakref.rst:440 +#: ../../library/weakref.rst:442 msgid "Finalizer Objects" msgstr "" -#: ../../library/weakref.rst:442 +#: ../../library/weakref.rst:444 msgid "" "The main benefit of using :class:`finalize` is that it makes it simple to " "register a callback without needing to preserve the returned finalizer " "object. For instance" msgstr "" -#: ../../library/weakref.rst:456 +#: ../../library/weakref.rst:458 msgid "" "The finalizer can be called directly as well. However the finalizer will " "invoke the callback at most once." msgstr "" -#: ../../library/weakref.rst:472 +#: ../../library/weakref.rst:474 msgid "" "You can unregister a finalizer using its :meth:`~finalize.detach` method. " "This kills the finalizer and returns the arguments passed to the constructor " "when it was created." msgstr "" -#: ../../library/weakref.rst:486 +#: ../../library/weakref.rst:488 msgid "" "Unless you set the :attr:`~finalize.atexit` attribute to :const:`False`, a " "finalizer will be called when the program exits if it is still alive. For " "instance" msgstr "" -#: ../../library/weakref.rst:501 +#: ../../library/weakref.rst:503 msgid "Comparing finalizers with :meth:`__del__` methods" msgstr "" -#: ../../library/weakref.rst:503 +#: ../../library/weakref.rst:505 msgid "" "Suppose we want to create a class whose instances represent temporary " "directories. The directories should be deleted with their contents when the " "first of the following events occurs:" msgstr "" -#: ../../library/weakref.rst:507 +#: ../../library/weakref.rst:509 msgid "the object is garbage collected," msgstr "" -#: ../../library/weakref.rst:508 +#: ../../library/weakref.rst:510 msgid "the object's :meth:`remove` method is called, or" msgstr "" -#: ../../library/weakref.rst:509 +#: ../../library/weakref.rst:511 msgid "the program exits." msgstr "" -#: ../../library/weakref.rst:511 +#: ../../library/weakref.rst:513 msgid "" "We might try to implement the class using a :meth:`__del__` method as " "follows::" msgstr "" -#: ../../library/weakref.rst:530 +#: ../../library/weakref.rst:532 msgid "" "Starting with Python 3.4, :meth:`__del__` methods no longer prevent " "reference cycles from being garbage collected, and module globals are no " @@ -528,35 +534,35 @@ msgid "" "code should work without any issues on CPython." msgstr "" -#: ../../library/weakref.rst:535 +#: ../../library/weakref.rst:537 msgid "" "However, handling of :meth:`__del__` methods is notoriously implementation " "specific, since it depends on internal details of the interpreter's garbage " "collector implementation." msgstr "" -#: ../../library/weakref.rst:539 +#: ../../library/weakref.rst:541 msgid "" "A more robust alternative can be to define a finalizer which only references " "the specific functions and objects that it needs, rather than having access " "to the full state of the object::" msgstr "" -#: ../../library/weakref.rst:555 +#: ../../library/weakref.rst:557 msgid "" "Defined like this, our finalizer only receives a reference to the details it " "needs to clean up the directory appropriately. If the object never gets " "garbage collected the finalizer will still be called at exit." msgstr "" -#: ../../library/weakref.rst:559 +#: ../../library/weakref.rst:561 msgid "" "The other advantage of weakref based finalizers is that they can be used to " "register finalizers for classes where the definition is controlled by a " "third party, such as running code when a module is unloaded::" msgstr "" -#: ../../library/weakref.rst:571 +#: ../../library/weakref.rst:573 msgid "" "If you create a finalizer object in a daemonic thread just as the program " "exits then there is the possibility that the finalizer does not get called " From edfb8ae2b06e6388210fde232fc443e4f49ae9cd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 5 Dec 2022 00:18:54 +0000 Subject: [PATCH 02/11] sync with cpython 9bcc68b0 --- library/asyncio-eventloop.po | 837 ++++++++++++++++++----------------- 1 file changed, 421 insertions(+), 416 deletions(-) diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 3c9e9e10ea5..8037feb4465 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-04 00:20+0000\n" +"POT-Creation-Date: 2022-12-05 00:16+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,125 +66,130 @@ msgid "Return the running event loop in the current OS thread." msgstr "" #: ../../library/asyncio-eventloop.rst:36 -msgid "" -"If there is no running event loop a :exc:`RuntimeError` is raised. This " -"function can only be called from a coroutine or a callback." +msgid "Raise a :exc:`RuntimeError` if there is no running event loop." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:38 +msgid "This function can only be called from a coroutine or a callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:43 +#: ../../library/asyncio-eventloop.rst:44 msgid "Get the current event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:45 +#: ../../library/asyncio-eventloop.rst:46 msgid "" "If there is no current event loop set in the current OS thread, the OS " "thread is main, and :func:`set_event_loop` has not yet been called, asyncio " "will create a new event loop and set it as the current one." msgstr "" -#: ../../library/asyncio-eventloop.rst:50 +#: ../../library/asyncio-eventloop.rst:51 msgid "" "Because this function has rather complex behavior (especially when custom " "event loop policies are in use), using the :func:`get_running_loop` function " "is preferred to :func:`get_event_loop` in coroutines and callbacks." msgstr "" -#: ../../library/asyncio-eventloop.rst:55 +#: ../../library/asyncio-eventloop.rst:56 msgid "" -"Consider also using the :func:`asyncio.run` function instead of using lower " -"level functions to manually create and close an event loop." +"As noted above, consider using the higher-level :func:`asyncio.run` " +"function, instead of using these lower level functions to manually create " +"and close an event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:58 +#: ../../library/asyncio-eventloop.rst:60 msgid "" -"Deprecation warning is emitted if there is no running event loop. In future " -"Python releases, this function will be an alias of :func:`get_running_loop`." +"Emits a deprecation warning if there is no running event loop. In future " +"Python releases, this function may become an alias of :func:" +"`get_running_loop` and will accordingly raise a :exc:`RuntimeError` if there " +"is no running event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:65 -msgid "Set *loop* as a current event loop for the current OS thread." +#: ../../library/asyncio-eventloop.rst:68 +msgid "Set *loop* as the current event loop for the current OS thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:69 +#: ../../library/asyncio-eventloop.rst:72 msgid "Create and return a new event loop object." msgstr "" -#: ../../library/asyncio-eventloop.rst:71 +#: ../../library/asyncio-eventloop.rst:74 msgid "" "Note that the behaviour of :func:`get_event_loop`, :func:`set_event_loop`, " "and :func:`new_event_loop` functions can be altered by :ref:`setting a " "custom event loop policy `." msgstr "" -#: ../../library/asyncio-eventloop.rst:77 +#: ../../library/asyncio-eventloop.rst:80 msgid "Contents" msgstr "目錄" -#: ../../library/asyncio-eventloop.rst:78 +#: ../../library/asyncio-eventloop.rst:81 msgid "This documentation page contains the following sections:" msgstr "" -#: ../../library/asyncio-eventloop.rst:80 +#: ../../library/asyncio-eventloop.rst:83 msgid "" "The `Event Loop Methods`_ section is the reference documentation of the " "event loop APIs;" msgstr "" -#: ../../library/asyncio-eventloop.rst:83 +#: ../../library/asyncio-eventloop.rst:86 msgid "" "The `Callback Handles`_ section documents the :class:`Handle` and :class:" "`TimerHandle` instances which are returned from scheduling methods such as :" "meth:`loop.call_soon` and :meth:`loop.call_later`;" msgstr "" -#: ../../library/asyncio-eventloop.rst:87 +#: ../../library/asyncio-eventloop.rst:90 msgid "" "The `Server Objects`_ section documents types returned from event loop " "methods like :meth:`loop.create_server`;" msgstr "" -#: ../../library/asyncio-eventloop.rst:90 +#: ../../library/asyncio-eventloop.rst:93 msgid "" "The `Event Loop Implementations`_ section documents the :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" msgstr "" -#: ../../library/asyncio-eventloop.rst:93 +#: ../../library/asyncio-eventloop.rst:96 msgid "" "The `Examples`_ section showcases how to work with some event loop APIs." msgstr "" -#: ../../library/asyncio-eventloop.rst:100 +#: ../../library/asyncio-eventloop.rst:103 msgid "Event Loop Methods" msgstr "" -#: ../../library/asyncio-eventloop.rst:102 +#: ../../library/asyncio-eventloop.rst:105 msgid "Event loops have **low-level** APIs for the following:" msgstr "" -#: ../../library/asyncio-eventloop.rst:110 +#: ../../library/asyncio-eventloop.rst:113 msgid "Running and stopping the loop" msgstr "" -#: ../../library/asyncio-eventloop.rst:114 +#: ../../library/asyncio-eventloop.rst:117 msgid "Run until the *future* (an instance of :class:`Future`) has completed." msgstr "" -#: ../../library/asyncio-eventloop.rst:117 +#: ../../library/asyncio-eventloop.rst:120 msgid "" "If the argument is a :ref:`coroutine object ` it is implicitly " "scheduled to run as a :class:`asyncio.Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:120 +#: ../../library/asyncio-eventloop.rst:123 msgid "Return the Future's result or raise its exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:124 +#: ../../library/asyncio-eventloop.rst:127 msgid "Run the event loop until :meth:`stop` is called." msgstr "" -#: ../../library/asyncio-eventloop.rst:126 +#: ../../library/asyncio-eventloop.rst:129 msgid "" "If :meth:`stop` is called before :meth:`run_forever()` is called, the loop " "will poll the I/O selector once with a timeout of zero, run all callbacks " @@ -192,7 +197,7 @@ msgid "" "and then exit." msgstr "" -#: ../../library/asyncio-eventloop.rst:131 +#: ../../library/asyncio-eventloop.rst:134 msgid "" "If :meth:`stop` is called while :meth:`run_forever` is running, the loop " "will run the current batch of callbacks and then exit. Note that new " @@ -201,41 +206,41 @@ msgid "" "called." msgstr "" -#: ../../library/asyncio-eventloop.rst:139 +#: ../../library/asyncio-eventloop.rst:142 msgid "Stop the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:143 +#: ../../library/asyncio-eventloop.rst:146 msgid "Return ``True`` if the event loop is currently running." msgstr "" -#: ../../library/asyncio-eventloop.rst:147 +#: ../../library/asyncio-eventloop.rst:150 msgid "Return ``True`` if the event loop was closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:151 +#: ../../library/asyncio-eventloop.rst:154 msgid "Close the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:153 +#: ../../library/asyncio-eventloop.rst:156 msgid "" "The loop must not be running when this function is called. Any pending " "callbacks will be discarded." msgstr "" -#: ../../library/asyncio-eventloop.rst:156 +#: ../../library/asyncio-eventloop.rst:159 msgid "" "This method clears all queues and shuts down the executor, but does not wait " "for the executor to finish." msgstr "" -#: ../../library/asyncio-eventloop.rst:159 +#: ../../library/asyncio-eventloop.rst:162 msgid "" "This method is idempotent and irreversible. No other methods should be " "called after the event loop is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:164 +#: ../../library/asyncio-eventloop.rst:167 msgid "" "Schedule all currently open :term:`asynchronous generator` objects to close " "with an :meth:`~agen.aclose()` call. After calling this method, the event " @@ -243,23 +248,23 @@ msgid "" "should be used to reliably finalize all scheduled asynchronous generators." msgstr "" -#: ../../library/asyncio-eventloop.rst:170 -#: ../../library/asyncio-eventloop.rst:190 +#: ../../library/asyncio-eventloop.rst:173 +#: ../../library/asyncio-eventloop.rst:193 msgid "" "Note that there is no need to call this function when :func:`asyncio.run` is " "used." msgstr "" -#: ../../library/asyncio-eventloop.rst:173 -#: ../../library/asyncio-eventloop.rst:1201 -#: ../../library/asyncio-eventloop.rst:1589 +#: ../../library/asyncio-eventloop.rst:176 +#: ../../library/asyncio-eventloop.rst:1204 +#: ../../library/asyncio-eventloop.rst:1592 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/asyncio-eventloop.rst:185 +#: ../../library/asyncio-eventloop.rst:188 msgid "" "Schedule the closure of the default executor and wait for it to join all of " "the threads in the :class:`ThreadPoolExecutor`. After calling this method, " @@ -267,207 +272,207 @@ msgid "" "called while using the default executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:197 +#: ../../library/asyncio-eventloop.rst:200 msgid "Scheduling callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:201 +#: ../../library/asyncio-eventloop.rst:204 msgid "" "Schedule the *callback* :term:`callback` to be called with *args* arguments " "at the next iteration of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:204 +#: ../../library/asyncio-eventloop.rst:207 msgid "" "Callbacks are called in the order in which they are registered. Each " "callback will be called exactly once." msgstr "" -#: ../../library/asyncio-eventloop.rst:207 -#: ../../library/asyncio-eventloop.rst:274 +#: ../../library/asyncio-eventloop.rst:210 +#: ../../library/asyncio-eventloop.rst:277 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *callback* to run in. The current " "context is used when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:211 +#: ../../library/asyncio-eventloop.rst:214 msgid "" "An instance of :class:`asyncio.Handle` is returned, which can be used later " "to cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:214 +#: ../../library/asyncio-eventloop.rst:217 msgid "This method is not thread-safe." msgstr "" -#: ../../library/asyncio-eventloop.rst:218 +#: ../../library/asyncio-eventloop.rst:221 msgid "" "A thread-safe variant of :meth:`call_soon`. Must be used to schedule " "callbacks *from another thread*." msgstr "" -#: ../../library/asyncio-eventloop.rst:221 +#: ../../library/asyncio-eventloop.rst:224 msgid "" "Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " "happen on a secondary thread when the main application is shutting down." msgstr "" -#: ../../library/asyncio-eventloop.rst:225 +#: ../../library/asyncio-eventloop.rst:228 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-eventloop.rst:228 -#: ../../library/asyncio-eventloop.rst:278 -#: ../../library/asyncio-eventloop.rst:298 +#: ../../library/asyncio-eventloop.rst:231 +#: ../../library/asyncio-eventloop.rst:281 +#: ../../library/asyncio-eventloop.rst:301 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "" -#: ../../library/asyncio-eventloop.rst:236 +#: ../../library/asyncio-eventloop.rst:239 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" msgstr "" -#: ../../library/asyncio-eventloop.rst:243 +#: ../../library/asyncio-eventloop.rst:246 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." msgstr "" -#: ../../library/asyncio-eventloop.rst:251 +#: ../../library/asyncio-eventloop.rst:254 msgid "Scheduling delayed callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:253 +#: ../../library/asyncio-eventloop.rst:256 msgid "" "Event loop provides mechanisms to schedule callback functions to be called " "at some point in the future. Event loop uses monotonic clocks to track time." msgstr "" -#: ../../library/asyncio-eventloop.rst:260 +#: ../../library/asyncio-eventloop.rst:263 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." msgstr "" -#: ../../library/asyncio-eventloop.rst:263 -#: ../../library/asyncio-eventloop.rst:295 +#: ../../library/asyncio-eventloop.rst:266 +#: ../../library/asyncio-eventloop.rst:298 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:266 +#: ../../library/asyncio-eventloop.rst:269 msgid "" "*callback* will be called exactly once. If two callbacks are scheduled for " "exactly the same time, the order in which they are called is undefined." msgstr "" -#: ../../library/asyncio-eventloop.rst:270 +#: ../../library/asyncio-eventloop.rst:273 msgid "" "The optional positional *args* will be passed to the callback when it is " "called. If you want the callback to be called with keyword arguments use :" "func:`functools.partial`." msgstr "" -#: ../../library/asyncio-eventloop.rst:282 +#: ../../library/asyncio-eventloop.rst:285 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "*delay* could not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:289 +#: ../../library/asyncio-eventloop.rst:292 msgid "" "Schedule *callback* to be called at the given absolute timestamp *when* (an " "int or a float), using the same time reference as :meth:`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:293 +#: ../../library/asyncio-eventloop.rst:296 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "" -#: ../../library/asyncio-eventloop.rst:302 +#: ../../library/asyncio-eventloop.rst:305 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "difference between *when* and the current time could not exceed one day. " "This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:309 +#: ../../library/asyncio-eventloop.rst:312 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." msgstr "" -#: ../../library/asyncio-eventloop.rst:313 +#: ../../library/asyncio-eventloop.rst:316 msgid "" "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " "should not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:319 +#: ../../library/asyncio-eventloop.rst:322 msgid "The :func:`asyncio.sleep` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:323 +#: ../../library/asyncio-eventloop.rst:326 msgid "Creating Futures and Tasks" msgstr "" -#: ../../library/asyncio-eventloop.rst:327 +#: ../../library/asyncio-eventloop.rst:330 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:329 +#: ../../library/asyncio-eventloop.rst:332 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " "(with better performance or instrumentation)." msgstr "" -#: ../../library/asyncio-eventloop.rst:337 +#: ../../library/asyncio-eventloop.rst:340 msgid "" "Schedule the execution of :ref:`coroutine ` *coro*. Return a :" "class:`Task` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:340 +#: ../../library/asyncio-eventloop.rst:343 msgid "" "Third-party event loops can use their own subclass of :class:`Task` for " "interoperability. In this case, the result type is a subclass of :class:" "`Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:344 +#: ../../library/asyncio-eventloop.rst:347 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." msgstr "" -#: ../../library/asyncio-eventloop.rst:347 +#: ../../library/asyncio-eventloop.rst:350 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. The current context " "copy is created when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:351 +#: ../../library/asyncio-eventloop.rst:354 msgid "Added the *name* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:354 +#: ../../library/asyncio-eventloop.rst:357 msgid "Added the *context* parameter." msgstr "加入 *context* 參數。" -#: ../../library/asyncio-eventloop.rst:359 +#: ../../library/asyncio-eventloop.rst:362 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:362 +#: ../../library/asyncio-eventloop.rst:365 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro, " @@ -476,82 +481,82 @@ msgid "" "Future`-compatible object." msgstr "" -#: ../../library/asyncio-eventloop.rst:370 +#: ../../library/asyncio-eventloop.rst:373 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "" -#: ../../library/asyncio-eventloop.rst:374 +#: ../../library/asyncio-eventloop.rst:377 msgid "Opening network connections" msgstr "" -#: ../../library/asyncio-eventloop.rst:384 +#: ../../library/asyncio-eventloop.rst:387 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:387 +#: ../../library/asyncio-eventloop.rst:390 msgid "" "The socket family can be either :py:data:`~socket.AF_INET` or :py:data:" "`~socket.AF_INET6` depending on *host* (or the *family* argument, if " "provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:391 +#: ../../library/asyncio-eventloop.rst:394 msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:393 -#: ../../library/asyncio-eventloop.rst:1117 -#: ../../library/asyncio-eventloop.rst:1133 +#: ../../library/asyncio-eventloop.rst:396 +#: ../../library/asyncio-eventloop.rst:1120 +#: ../../library/asyncio-eventloop.rst:1136 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:396 +#: ../../library/asyncio-eventloop.rst:399 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:399 +#: ../../library/asyncio-eventloop.rst:402 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "" -#: ../../library/asyncio-eventloop.rst:401 +#: ../../library/asyncio-eventloop.rst:404 msgid "" "The connection is established and a :ref:`transport ` is " "created for it." msgstr "" -#: ../../library/asyncio-eventloop.rst:404 +#: ../../library/asyncio-eventloop.rst:407 msgid "" "*protocol_factory* is called without arguments and is expected to return a :" "ref:`protocol ` instance." msgstr "" -#: ../../library/asyncio-eventloop.rst:407 +#: ../../library/asyncio-eventloop.rst:410 msgid "" "The protocol instance is coupled with the transport by calling its :meth:" "`~BaseProtocol.connection_made` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:410 +#: ../../library/asyncio-eventloop.rst:413 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:412 +#: ../../library/asyncio-eventloop.rst:415 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "" -#: ../../library/asyncio-eventloop.rst:415 -#: ../../library/asyncio-eventloop.rst:536 +#: ../../library/asyncio-eventloop.rst:418 +#: ../../library/asyncio-eventloop.rst:539 msgid "Other arguments:" msgstr "" -#: ../../library/asyncio-eventloop.rst:417 +#: ../../library/asyncio-eventloop.rst:420 msgid "" "*ssl*: if given and not false, a SSL/TLS transport is created (by default a " "plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " @@ -560,11 +565,11 @@ msgid "" "is used." msgstr "" -#: ../../library/asyncio-eventloop.rst:423 +#: ../../library/asyncio-eventloop.rst:426 msgid ":ref:`SSL/TLS security considerations `" msgstr "" -#: ../../library/asyncio-eventloop.rst:425 +#: ../../library/asyncio-eventloop.rst:428 msgid "" "*server_hostname* sets or overrides the hostname that the target server's " "certificate will be matched against. Should only be passed if *ssl* is not " @@ -575,7 +580,7 @@ msgid "" "potential man-in-the-middle attacks)." msgstr "" -#: ../../library/asyncio-eventloop.rst:433 +#: ../../library/asyncio-eventloop.rst:436 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -583,28 +588,28 @@ msgid "" "constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:438 +#: ../../library/asyncio-eventloop.rst:441 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " "time in seconds to wait for a connection attempt to complete, before " -"starting the next attempt in parallel. This is the \"Connection Attempt Delay" -"\" as defined in :rfc:`8305`. A sensible default value recommended by the " -"RFC is ``0.25`` (250 milliseconds)." +"starting the next attempt in parallel. This is the \"Connection Attempt " +"Delay\" as defined in :rfc:`8305`. A sensible default value recommended by " +"the RFC is ``0.25`` (250 milliseconds)." msgstr "" -#: ../../library/asyncio-eventloop.rst:446 +#: ../../library/asyncio-eventloop.rst:449 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " "addresses are tried in the order returned by :meth:`getaddrinfo`. If a " "positive integer is specified, the addresses are interleaved by address " -"family, and the given integer is interpreted as \"First Address Family Count" -"\" as defined in :rfc:`8305`. The default is ``0`` if *happy_eyeballs_delay* " -"is not specified, and ``1`` if it is." +"family, and the given integer is interpreted as \"First Address Family " +"Count\" as defined in :rfc:`8305`. The default is ``0`` if " +"*happy_eyeballs_delay* is not specified, and ``1`` if it is." msgstr "" -#: ../../library/asyncio-eventloop.rst:455 +#: ../../library/asyncio-eventloop.rst:458 msgid "" "*sock*, if given, should be an existing, already connected :class:`socket." "socket` object to be used by the transport. If *sock* is given, none of " @@ -612,61 +617,61 @@ msgid "" "*interleave* and *local_addr* should be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:463 -#: ../../library/asyncio-eventloop.rst:567 -#: ../../library/asyncio-eventloop.rst:791 +#: ../../library/asyncio-eventloop.rst:466 +#: ../../library/asyncio-eventloop.rst:570 +#: ../../library/asyncio-eventloop.rst:794 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." "BaseTransport.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:467 +#: ../../library/asyncio-eventloop.rst:470 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using " "``getaddrinfo()``, similarly to *host* and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:471 -#: ../../library/asyncio-eventloop.rst:882 +#: ../../library/asyncio-eventloop.rst:474 +#: ../../library/asyncio-eventloop.rst:885 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:475 -#: ../../library/asyncio-eventloop.rst:708 -#: ../../library/asyncio-eventloop.rst:802 -#: ../../library/asyncio-eventloop.rst:886 +#: ../../library/asyncio-eventloop.rst:478 +#: ../../library/asyncio-eventloop.rst:711 +#: ../../library/asyncio-eventloop.rst:805 +#: ../../library/asyncio-eventloop.rst:889 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:481 -#: ../../library/asyncio-eventloop.rst:720 +#: ../../library/asyncio-eventloop.rst:484 +#: ../../library/asyncio-eventloop.rst:723 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:485 +#: ../../library/asyncio-eventloop.rst:488 msgid "" "The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " "TCP connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:490 -#: ../../library/asyncio-eventloop.rst:812 +#: ../../library/asyncio-eventloop.rst:493 +#: ../../library/asyncio-eventloop.rst:815 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:494 +#: ../../library/asyncio-eventloop.rst:497 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "加入 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-eventloop.rst:496 +#: ../../library/asyncio-eventloop.rst:499 msgid "" "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " "IPv4 path and protocol are working, but the server's IPv6 path and protocol " @@ -677,69 +682,69 @@ msgid "" "visible delay and provides an algorithm." msgstr "" -#: ../../library/asyncio-eventloop.rst:505 +#: ../../library/asyncio-eventloop.rst:508 msgid "For more information: https://tools.ietf.org/html/rfc6555" msgstr "更多資訊請見:\\ https://tools.ietf.org/html/rfc6555" -#: ../../library/asyncio-eventloop.rst:509 -#: ../../library/asyncio-eventloop.rst:628 -#: ../../library/asyncio-eventloop.rst:734 -#: ../../library/asyncio-eventloop.rst:769 -#: ../../library/asyncio-eventloop.rst:816 -#: ../../library/asyncio-eventloop.rst:894 +#: ../../library/asyncio-eventloop.rst:512 +#: ../../library/asyncio-eventloop.rst:631 +#: ../../library/asyncio-eventloop.rst:737 +#: ../../library/asyncio-eventloop.rst:772 +#: ../../library/asyncio-eventloop.rst:819 +#: ../../library/asyncio-eventloop.rst:897 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:513 +#: ../../library/asyncio-eventloop.rst:516 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " "used directly in async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:523 +#: ../../library/asyncio-eventloop.rst:526 msgid "Create a datagram connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:525 +#: ../../library/asyncio-eventloop.rst:528 msgid "" "The socket family can be either :py:data:`~socket.AF_INET`, :py:data:" "`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`, depending on *host* (or " "the *family* argument, if provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:529 +#: ../../library/asyncio-eventloop.rst:532 msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:531 -#: ../../library/asyncio-eventloop.rst:651 -#: ../../library/asyncio-eventloop.rst:783 +#: ../../library/asyncio-eventloop.rst:534 +#: ../../library/asyncio-eventloop.rst:654 +#: ../../library/asyncio-eventloop.rst:786 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:534 -#: ../../library/asyncio-eventloop.rst:610 +#: ../../library/asyncio-eventloop.rst:537 +#: ../../library/asyncio-eventloop.rst:613 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:538 +#: ../../library/asyncio-eventloop.rst:541 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using :" "meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:542 +#: ../../library/asyncio-eventloop.rst:545 msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " "connect the socket to a remote address. The *remote_host* and *remote_port* " "are looked up using :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:546 +#: ../../library/asyncio-eventloop.rst:549 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -747,7 +752,7 @@ msgid "" "module constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:551 +#: ../../library/asyncio-eventloop.rst:554 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " @@ -756,13 +761,13 @@ msgid "" "this capability is unsupported." msgstr "" -#: ../../library/asyncio-eventloop.rst:557 +#: ../../library/asyncio-eventloop.rst:560 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "" -#: ../../library/asyncio-eventloop.rst:560 +#: ../../library/asyncio-eventloop.rst:563 msgid "" "*sock* can optionally be specified in order to use a preexisting, already " "connected, :class:`socket.socket` object to be used by the transport. If " @@ -770,33 +775,33 @@ msgid "" "`None`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:571 +#: ../../library/asyncio-eventloop.rst:574 msgid "" "See :ref:`UDP echo client protocol ` and :" "ref:`UDP echo server protocol ` examples." msgstr "" -#: ../../library/asyncio-eventloop.rst:574 +#: ../../library/asyncio-eventloop.rst:577 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " "*allow_broadcast*, and *sock* parameters were added." msgstr "" -#: ../../library/asyncio-eventloop.rst:578 +#: ../../library/asyncio-eventloop.rst:581 msgid "" "The *reuse_address* parameter is no longer supported, as using :py:data:" "`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " "Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:583 +#: ../../library/asyncio-eventloop.rst:586 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:587 +#: ../../library/asyncio-eventloop.rst:590 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :py:data:`~sockets.SO_REUSEPORT` " @@ -804,95 +809,95 @@ msgid "" "from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:593 +#: ../../library/asyncio-eventloop.rst:596 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:596 +#: ../../library/asyncio-eventloop.rst:599 msgid "" "The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" -#: ../../library/asyncio-eventloop.rst:605 +#: ../../library/asyncio-eventloop.rst:608 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:607 +#: ../../library/asyncio-eventloop.rst:610 msgid "" "The socket family will be :py:data:`~socket.AF_UNIX`; socket type will be :" "py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:612 +#: ../../library/asyncio-eventloop.rst:615 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" "`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:617 +#: ../../library/asyncio-eventloop.rst:620 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:621 -#: ../../library/asyncio-eventloop.rst:761 -#: ../../library/asyncio-eventloop.rst:1184 +#: ../../library/asyncio-eventloop.rst:624 +#: ../../library/asyncio-eventloop.rst:764 +#: ../../library/asyncio-eventloop.rst:1187 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-eventloop.rst:622 +#: ../../library/asyncio-eventloop.rst:625 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:632 +#: ../../library/asyncio-eventloop.rst:635 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:644 +#: ../../library/asyncio-eventloop.rst:647 msgid "" "Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:647 +#: ../../library/asyncio-eventloop.rst:650 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:649 +#: ../../library/asyncio-eventloop.rst:652 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:654 +#: ../../library/asyncio-eventloop.rst:657 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:657 +#: ../../library/asyncio-eventloop.rst:660 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:660 +#: ../../library/asyncio-eventloop.rst:663 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: ../../library/asyncio-eventloop.rst:663 +#: ../../library/asyncio-eventloop.rst:666 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: ../../library/asyncio-eventloop.rst:667 +#: ../../library/asyncio-eventloop.rst:670 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " @@ -900,63 +905,63 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: ../../library/asyncio-eventloop.rst:672 +#: ../../library/asyncio-eventloop.rst:675 msgid "" "*family* can be set to either :data:`socket.AF_INET` or :data:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :data:`~socket.AF_UNSPEC`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:677 +#: ../../library/asyncio-eventloop.rst:680 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:679 +#: ../../library/asyncio-eventloop.rst:682 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:684 +#: ../../library/asyncio-eventloop.rst:687 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:688 +#: ../../library/asyncio-eventloop.rst:691 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:691 +#: ../../library/asyncio-eventloop.rst:694 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:694 +#: ../../library/asyncio-eventloop.rst:697 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:699 +#: ../../library/asyncio-eventloop.rst:702 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:704 +#: ../../library/asyncio-eventloop.rst:707 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:712 +#: ../../library/asyncio-eventloop.rst:715 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -964,44 +969,44 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:724 +#: ../../library/asyncio-eventloop.rst:727 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:728 +#: ../../library/asyncio-eventloop.rst:731 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " "option :py:data:`~socket.TCP_NODELAY` is set by default for all TCP " "connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:738 +#: ../../library/asyncio-eventloop.rst:741 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:749 +#: ../../library/asyncio-eventloop.rst:752 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:752 +#: ../../library/asyncio-eventloop.rst:755 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:757 +#: ../../library/asyncio-eventloop.rst:760 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:764 +#: ../../library/asyncio-eventloop.rst:767 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1009,63 +1014,63 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" "一個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:776 +#: ../../library/asyncio-eventloop.rst:779 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:778 +#: ../../library/asyncio-eventloop.rst:781 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: ../../library/asyncio-eventloop.rst:781 -#: ../../library/asyncio-eventloop.rst:868 +#: ../../library/asyncio-eventloop.rst:784 +#: ../../library/asyncio-eventloop.rst:871 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:786 +#: ../../library/asyncio-eventloop.rst:789 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:795 +#: ../../library/asyncio-eventloop.rst:798 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:798 +#: ../../library/asyncio-eventloop.rst:801 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:806 +#: ../../library/asyncio-eventloop.rst:809 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:820 +#: ../../library/asyncio-eventloop.rst:823 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:825 +#: ../../library/asyncio-eventloop.rst:828 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:828 +#: ../../library/asyncio-eventloop.rst:831 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:830 +#: ../../library/asyncio-eventloop.rst:833 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:832 -#: ../../library/asyncio-eventloop.rst:1072 +#: ../../library/asyncio-eventloop.rst:835 +#: ../../library/asyncio-eventloop.rst:1075 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1074,35 +1079,35 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:839 +#: ../../library/asyncio-eventloop.rst:842 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:843 +#: ../../library/asyncio-eventloop.rst:846 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:850 +#: ../../library/asyncio-eventloop.rst:853 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:857 +#: ../../library/asyncio-eventloop.rst:860 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:859 +#: ../../library/asyncio-eventloop.rst:862 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " "protocol and *protocol*-facing transport." msgstr "" -#: ../../library/asyncio-eventloop.rst:863 +#: ../../library/asyncio-eventloop.rst:866 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1110,70 +1115,70 @@ msgid "" "exchanges extra TLS session packets with *transport*." msgstr "" -#: ../../library/asyncio-eventloop.rst:870 +#: ../../library/asyncio-eventloop.rst:873 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:874 +#: ../../library/asyncio-eventloop.rst:877 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:876 +#: ../../library/asyncio-eventloop.rst:879 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:879 +#: ../../library/asyncio-eventloop.rst:882 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:899 +#: ../../library/asyncio-eventloop.rst:902 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:903 +#: ../../library/asyncio-eventloop.rst:906 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:909 +#: ../../library/asyncio-eventloop.rst:912 msgid "Stop monitoring the *fd* file descriptor for read availability." msgstr "" -#: ../../library/asyncio-eventloop.rst:913 +#: ../../library/asyncio-eventloop.rst:916 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:917 -#: ../../library/asyncio-eventloop.rst:1171 +#: ../../library/asyncio-eventloop.rst:920 +#: ../../library/asyncio-eventloop.rst:1174 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:922 +#: ../../library/asyncio-eventloop.rst:925 msgid "Stop monitoring the *fd* file descriptor for write availability." msgstr "" -#: ../../library/asyncio-eventloop.rst:924 +#: ../../library/asyncio-eventloop.rst:927 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:929 +#: ../../library/asyncio-eventloop.rst:932 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:931 +#: ../../library/asyncio-eventloop.rst:934 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1182,72 +1187,72 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:940 +#: ../../library/asyncio-eventloop.rst:943 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:943 +#: ../../library/asyncio-eventloop.rst:946 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:945 -#: ../../library/asyncio-eventloop.rst:959 -#: ../../library/asyncio-eventloop.rst:970 -#: ../../library/asyncio-eventloop.rst:982 -#: ../../library/asyncio-eventloop.rst:997 -#: ../../library/asyncio-eventloop.rst:1012 -#: ../../library/asyncio-eventloop.rst:1022 -#: ../../library/asyncio-eventloop.rst:1048 -#: ../../library/asyncio-eventloop.rst:1086 +#: ../../library/asyncio-eventloop.rst:948 +#: ../../library/asyncio-eventloop.rst:962 +#: ../../library/asyncio-eventloop.rst:973 +#: ../../library/asyncio-eventloop.rst:985 +#: ../../library/asyncio-eventloop.rst:1000 +#: ../../library/asyncio-eventloop.rst:1015 +#: ../../library/asyncio-eventloop.rst:1025 +#: ../../library/asyncio-eventloop.rst:1051 +#: ../../library/asyncio-eventloop.rst:1089 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:947 +#: ../../library/asyncio-eventloop.rst:950 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:954 +#: ../../library/asyncio-eventloop.rst:957 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:957 +#: ../../library/asyncio-eventloop.rst:960 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:965 +#: ../../library/asyncio-eventloop.rst:968 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:968 +#: ../../library/asyncio-eventloop.rst:971 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:976 +#: ../../library/asyncio-eventloop.rst:979 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:980 +#: ../../library/asyncio-eventloop.rst:983 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:988 +#: ../../library/asyncio-eventloop.rst:991 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:991 +#: ../../library/asyncio-eventloop.rst:994 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1256,34 +1261,34 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:999 -#: ../../library/asyncio-eventloop.rst:1050 +#: ../../library/asyncio-eventloop.rst:1002 +#: ../../library/asyncio-eventloop.rst:1053 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1006 +#: ../../library/asyncio-eventloop.rst:1009 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1010 +#: ../../library/asyncio-eventloop.rst:1013 msgid "Return the number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1018 +#: ../../library/asyncio-eventloop.rst:1021 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1020 +#: ../../library/asyncio-eventloop.rst:1023 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1024 +#: ../../library/asyncio-eventloop.rst:1027 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1291,19 +1296,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1033 +#: ../../library/asyncio-eventloop.rst:1036 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1039 +#: ../../library/asyncio-eventloop.rst:1042 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1042 +#: ../../library/asyncio-eventloop.rst:1045 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1311,57 +1316,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1057 +#: ../../library/asyncio-eventloop.rst:1060 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:1062 +#: ../../library/asyncio-eventloop.rst:1065 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1065 +#: ../../library/asyncio-eventloop.rst:1068 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1067 +#: ../../library/asyncio-eventloop.rst:1070 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1070 +#: ../../library/asyncio-eventloop.rst:1073 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1079 +#: ../../library/asyncio-eventloop.rst:1082 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1083 +#: ../../library/asyncio-eventloop.rst:1086 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1092 +#: ../../library/asyncio-eventloop.rst:1095 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1097 +#: ../../library/asyncio-eventloop.rst:1100 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1101 +#: ../../library/asyncio-eventloop.rst:1104 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1103 +#: ../../library/asyncio-eventloop.rst:1106 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1369,67 +1374,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:1111 +#: ../../library/asyncio-eventloop.rst:1114 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:1115 +#: ../../library/asyncio-eventloop.rst:1118 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1120 +#: ../../library/asyncio-eventloop.rst:1123 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1122 +#: ../../library/asyncio-eventloop.rst:1125 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1126 -#: ../../library/asyncio-eventloop.rst:1142 +#: ../../library/asyncio-eventloop.rst:1129 +#: ../../library/asyncio-eventloop.rst:1145 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1131 +#: ../../library/asyncio-eventloop.rst:1134 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1136 +#: ../../library/asyncio-eventloop.rst:1139 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1138 +#: ../../library/asyncio-eventloop.rst:1141 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1147 +#: ../../library/asyncio-eventloop.rst:1150 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1152 +#: ../../library/asyncio-eventloop.rst:1155 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1157 +#: ../../library/asyncio-eventloop.rst:1160 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1161 +#: ../../library/asyncio-eventloop.rst:1164 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1163 +#: ../../library/asyncio-eventloop.rst:1166 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1437,46 +1442,46 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1168 +#: ../../library/asyncio-eventloop.rst:1171 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1174 +#: ../../library/asyncio-eventloop.rst:1177 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1179 +#: ../../library/asyncio-eventloop.rst:1182 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1181 +#: ../../library/asyncio-eventloop.rst:1184 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1188 +#: ../../library/asyncio-eventloop.rst:1191 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1192 +#: ../../library/asyncio-eventloop.rst:1195 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1196 +#: ../../library/asyncio-eventloop.rst:1199 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1198 +#: ../../library/asyncio-eventloop.rst:1201 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1243 +#: ../../library/asyncio-eventloop.rst:1246 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1484,17 +1489,17 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1248 +#: ../../library/asyncio-eventloop.rst:1251 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1250 +#: ../../library/asyncio-eventloop.rst:1253 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1253 +#: ../../library/asyncio-eventloop.rst:1256 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1502,32 +1507,32 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1262 +#: ../../library/asyncio-eventloop.rst:1265 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1266 +#: ../../library/asyncio-eventloop.rst:1269 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1272 +#: ../../library/asyncio-eventloop.rst:1275 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1274 +#: ../../library/asyncio-eventloop.rst:1277 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1278 +#: ../../library/asyncio-eventloop.rst:1281 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1280 +#: ../../library/asyncio-eventloop.rst:1283 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1536,158 +1541,158 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1290 +#: ../../library/asyncio-eventloop.rst:1293 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1297 +#: ../../library/asyncio-eventloop.rst:1300 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1299 +#: ../../library/asyncio-eventloop.rst:1302 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1303 +#: ../../library/asyncio-eventloop.rst:1306 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1308 +#: ../../library/asyncio-eventloop.rst:1311 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1310 +#: ../../library/asyncio-eventloop.rst:1313 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1313 +#: ../../library/asyncio-eventloop.rst:1316 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1314 +#: ../../library/asyncio-eventloop.rst:1317 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1315 +#: ../../library/asyncio-eventloop.rst:1318 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1316 +#: ../../library/asyncio-eventloop.rst:1319 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1317 +#: ../../library/asyncio-eventloop.rst:1320 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1318 +#: ../../library/asyncio-eventloop.rst:1321 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1319 +#: ../../library/asyncio-eventloop.rst:1322 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1320 +#: ../../library/asyncio-eventloop.rst:1323 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1322 +#: ../../library/asyncio-eventloop.rst:1325 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1322 +#: ../../library/asyncio-eventloop.rst:1325 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1326 +#: ../../library/asyncio-eventloop.rst:1329 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1331 +#: ../../library/asyncio-eventloop.rst:1334 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1335 +#: ../../library/asyncio-eventloop.rst:1338 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1337 +#: ../../library/asyncio-eventloop.rst:1340 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1343 +#: ../../library/asyncio-eventloop.rst:1346 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1347 +#: ../../library/asyncio-eventloop.rst:1350 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1352 +#: ../../library/asyncio-eventloop.rst:1355 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1356 +#: ../../library/asyncio-eventloop.rst:1359 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1358 +#: ../../library/asyncio-eventloop.rst:1361 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1365 +#: ../../library/asyncio-eventloop.rst:1368 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1374 +#: ../../library/asyncio-eventloop.rst:1377 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1377 +#: ../../library/asyncio-eventloop.rst:1380 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1379 +#: ../../library/asyncio-eventloop.rst:1382 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1380 +#: ../../library/asyncio-eventloop.rst:1383 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1383 +#: ../../library/asyncio-eventloop.rst:1386 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1387 +#: ../../library/asyncio-eventloop.rst:1390 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1695,136 +1700,136 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1393 +#: ../../library/asyncio-eventloop.rst:1396 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1396 +#: ../../library/asyncio-eventloop.rst:1399 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1398 +#: ../../library/asyncio-eventloop.rst:1401 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1400 +#: ../../library/asyncio-eventloop.rst:1403 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard input stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1403 -#: ../../library/asyncio-eventloop.rst:1415 -#: ../../library/asyncio-eventloop.rst:1427 +#: ../../library/asyncio-eventloop.rst:1406 +#: ../../library/asyncio-eventloop.rst:1418 +#: ../../library/asyncio-eventloop.rst:1430 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1405 -#: ../../library/asyncio-eventloop.rst:1417 -#: ../../library/asyncio-eventloop.rst:1429 +#: ../../library/asyncio-eventloop.rst:1408 +#: ../../library/asyncio-eventloop.rst:1420 +#: ../../library/asyncio-eventloop.rst:1432 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1407 -#: ../../library/asyncio-eventloop.rst:1419 -#: ../../library/asyncio-eventloop.rst:1431 +#: ../../library/asyncio-eventloop.rst:1410 +#: ../../library/asyncio-eventloop.rst:1422 +#: ../../library/asyncio-eventloop.rst:1434 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1410 +#: ../../library/asyncio-eventloop.rst:1413 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1412 +#: ../../library/asyncio-eventloop.rst:1415 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard output stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1422 +#: ../../library/asyncio-eventloop.rst:1425 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1424 +#: ../../library/asyncio-eventloop.rst:1427 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard error stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1433 +#: ../../library/asyncio-eventloop.rst:1436 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1436 +#: ../../library/asyncio-eventloop.rst:1439 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1441 +#: ../../library/asyncio-eventloop.rst:1444 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1445 +#: ../../library/asyncio-eventloop.rst:1448 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1448 +#: ../../library/asyncio-eventloop.rst:1451 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1456 +#: ../../library/asyncio-eventloop.rst:1459 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1461 +#: ../../library/asyncio-eventloop.rst:1464 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:1467 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1467 +#: ../../library/asyncio-eventloop.rst:1470 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1470 +#: ../../library/asyncio-eventloop.rst:1473 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1475 +#: ../../library/asyncio-eventloop.rst:1478 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1834,105 +1839,105 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1484 +#: ../../library/asyncio-eventloop.rst:1487 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1488 +#: ../../library/asyncio-eventloop.rst:1491 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1493 +#: ../../library/asyncio-eventloop.rst:1496 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1498 +#: ../../library/asyncio-eventloop.rst:1501 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1504 +#: ../../library/asyncio-eventloop.rst:1507 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1507 +#: ../../library/asyncio-eventloop.rst:1510 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1511 +#: ../../library/asyncio-eventloop.rst:1514 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1513 +#: ../../library/asyncio-eventloop.rst:1516 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1520 +#: ../../library/asyncio-eventloop.rst:1523 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1522 +#: ../../library/asyncio-eventloop.rst:1525 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1526 +#: ../../library/asyncio-eventloop.rst:1529 msgid "Do not instantiate the class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1530 +#: ../../library/asyncio-eventloop.rst:1533 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1543 +#: ../../library/asyncio-eventloop.rst:1546 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1548 +#: ../../library/asyncio-eventloop.rst:1551 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1551 +#: ../../library/asyncio-eventloop.rst:1554 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1554 +#: ../../library/asyncio-eventloop.rst:1557 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1559 +#: ../../library/asyncio-eventloop.rst:1562 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1565 +#: ../../library/asyncio-eventloop.rst:1568 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1567 +#: ../../library/asyncio-eventloop.rst:1570 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1570 +#: ../../library/asyncio-eventloop.rst:1573 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -1941,96 +1946,96 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1581 +#: ../../library/asyncio-eventloop.rst:1584 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1585 +#: ../../library/asyncio-eventloop.rst:1588 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1607 +#: ../../library/asyncio-eventloop.rst:1610 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1613 +#: ../../library/asyncio-eventloop.rst:1616 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1617 +#: ../../library/asyncio-eventloop.rst:1620 msgid "List of :class:`socket.socket` objects the server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1619 +#: ../../library/asyncio-eventloop.rst:1622 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1629 +#: ../../library/asyncio-eventloop.rst:1632 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1631 +#: ../../library/asyncio-eventloop.rst:1634 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1634 +#: ../../library/asyncio-eventloop.rst:1637 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1640 +#: ../../library/asyncio-eventloop.rst:1643 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1642 +#: ../../library/asyncio-eventloop.rst:1645 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1657 +#: ../../library/asyncio-eventloop.rst:1660 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1662 +#: ../../library/asyncio-eventloop.rst:1665 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1665 +#: ../../library/asyncio-eventloop.rst:1668 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1668 +#: ../../library/asyncio-eventloop.rst:1671 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1674 +#: ../../library/asyncio-eventloop.rst:1677 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1676 +#: ../../library/asyncio-eventloop.rst:1679 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1682 +#: ../../library/asyncio-eventloop.rst:1685 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1684 +#: ../../library/asyncio-eventloop.rst:1687 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2038,70 +2043,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1694 +#: ../../library/asyncio-eventloop.rst:1697 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1696 +#: ../../library/asyncio-eventloop.rst:1699 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1720 +#: ../../library/asyncio-eventloop.rst:1723 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1727 +#: ../../library/asyncio-eventloop.rst:1730 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1729 +#: ../../library/asyncio-eventloop.rst:1732 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1757 +#: ../../library/asyncio-eventloop.rst:1760 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1764 +#: ../../library/asyncio-eventloop.rst:1767 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1766 +#: ../../library/asyncio-eventloop.rst:1769 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1804 +#: ../../library/asyncio-eventloop.rst:1807 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1808 +#: ../../library/asyncio-eventloop.rst:1811 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1816 +#: ../../library/asyncio-eventloop.rst:1819 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1818 +#: ../../library/asyncio-eventloop.rst:1821 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1820 +#: ../../library/asyncio-eventloop.rst:1823 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" From 7436e6ea8e070b6e8a90d15c7444fc037c3d7928 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 6 Dec 2022 00:17:43 +0000 Subject: [PATCH 03/11] sync with cpython b2ff0f76 --- library/dataclasses.po | 218 ++++++++++++++++++++--------------------- library/enum.po | 42 ++++---- library/http.server.po | 15 ++- 3 files changed, 145 insertions(+), 130 deletions(-) diff --git a/library/dataclasses.po b/library/dataclasses.po index 9209a49a1ca..5d6ca800de5 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-12-06 00:15+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -87,21 +87,21 @@ msgid "" "is, these three uses of :func:`dataclass` are equivalent::" msgstr "" -#: ../../library/dataclasses.rst:86 +#: ../../library/dataclasses.rst:87 msgid "The parameters to :func:`dataclass` are:" msgstr "" -#: ../../library/dataclasses.rst:88 +#: ../../library/dataclasses.rst:89 msgid "" "``init``: If true (the default), a :meth:`__init__` method will be generated." msgstr "" -#: ../../library/dataclasses.rst:91 +#: ../../library/dataclasses.rst:92 msgid "" "If the class already defines :meth:`__init__`, this parameter is ignored." msgstr "" -#: ../../library/dataclasses.rst:94 +#: ../../library/dataclasses.rst:95 msgid "" "``repr``: If true (the default), a :meth:`__repr__` method will be " "generated. The generated repr string will have the class name and the name " @@ -111,23 +111,23 @@ msgid "" "quantity_on_hand=10)``." msgstr "" -#: ../../library/dataclasses.rst:101 +#: ../../library/dataclasses.rst:102 msgid "" "If the class already defines :meth:`__repr__`, this parameter is ignored." msgstr "" -#: ../../library/dataclasses.rst:104 +#: ../../library/dataclasses.rst:105 msgid "" "``eq``: If true (the default), an :meth:`__eq__` method will be generated. " "This method compares the class as if it were a tuple of its fields, in " "order. Both instances in the comparison must be of the identical type." msgstr "" -#: ../../library/dataclasses.rst:109 +#: ../../library/dataclasses.rst:110 msgid "If the class already defines :meth:`__eq__`, this parameter is ignored." msgstr "" -#: ../../library/dataclasses.rst:112 +#: ../../library/dataclasses.rst:113 msgid "" "``order``: If true (the default is ``False``), :meth:`__lt__`, :meth:" "`__le__`, :meth:`__gt__`, and :meth:`__ge__` methods will be generated. " @@ -136,19 +136,19 @@ msgid "" "true and ``eq`` is false, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/dataclasses.rst:119 +#: ../../library/dataclasses.rst:120 msgid "" "If the class already defines any of :meth:`__lt__`, :meth:`__le__`, :meth:" "`__gt__`, or :meth:`__ge__`, then :exc:`TypeError` is raised." msgstr "" -#: ../../library/dataclasses.rst:123 +#: ../../library/dataclasses.rst:124 msgid "" "``unsafe_hash``: If ``False`` (the default), a :meth:`__hash__` method is " "generated according to how ``eq`` and ``frozen`` are set." msgstr "" -#: ../../library/dataclasses.rst:126 +#: ../../library/dataclasses.rst:127 msgid "" ":meth:`__hash__` is used by built-in :meth:`hash()`, and when objects are " "added to hashed collections such as dictionaries and sets. Having a :meth:" @@ -158,7 +158,7 @@ msgid "" "``frozen`` flags in the :func:`dataclass` decorator." msgstr "" -#: ../../library/dataclasses.rst:133 +#: ../../library/dataclasses.rst:134 msgid "" "By default, :func:`dataclass` will not implicitly add a :meth:`__hash__` " "method unless it is safe to do so. Neither will it add or change an " @@ -167,7 +167,7 @@ msgid "" "in the :meth:`__hash__` documentation." msgstr "" -#: ../../library/dataclasses.rst:139 +#: ../../library/dataclasses.rst:140 msgid "" "If :meth:`__hash__` is not explicitly defined, or if it is set to ``None``, " "then :func:`dataclass` *may* add an implicit :meth:`__hash__` method. " @@ -177,7 +177,7 @@ msgid "" "specialized use case and should be considered carefully." msgstr "" -#: ../../library/dataclasses.rst:146 +#: ../../library/dataclasses.rst:147 msgid "" "Here are the rules governing implicit creation of a :meth:`__hash__` " "method. Note that you cannot both have an explicit :meth:`__hash__` method " @@ -185,7 +185,7 @@ msgid "" "`TypeError`." msgstr "" -#: ../../library/dataclasses.rst:151 +#: ../../library/dataclasses.rst:152 msgid "" "If ``eq`` and ``frozen`` are both true, by default :func:`dataclass` will " "generate a :meth:`__hash__` method for you. If ``eq`` is true and " @@ -196,7 +196,7 @@ msgid "" "will fall back to id-based hashing)." msgstr "" -#: ../../library/dataclasses.rst:159 +#: ../../library/dataclasses.rst:160 msgid "" "``frozen``: If true (the default is ``False``), assigning to fields will " "generate an exception. This emulates read-only frozen instances. If :meth:" @@ -204,7 +204,7 @@ msgid "" "`TypeError` is raised. See the discussion below." msgstr "" -#: ../../library/dataclasses.rst:164 +#: ../../library/dataclasses.rst:165 msgid "" "``match_args``: If true (the default is ``True``), the ``__match_args__`` " "tuple will be created from the list of parameters to the generated :meth:" @@ -213,7 +213,7 @@ msgid "" "``__match_args__`` will not be generated." msgstr "" -#: ../../library/dataclasses.rst:173 +#: ../../library/dataclasses.rst:174 msgid "" "``kw_only``: If true (the default value is ``False``), then all fields will " "be marked as keyword-only. If a field is marked as keyword-only, then the " @@ -224,7 +224,7 @@ msgid "" "section." msgstr "" -#: ../../library/dataclasses.rst:184 +#: ../../library/dataclasses.rst:185 msgid "" "``slots``: If true (the default is ``False``), :attr:`__slots__` attribute " "will be generated and new class will be returned instead of the original " @@ -232,7 +232,7 @@ msgid "" "`TypeError` is raised." msgstr "" -#: ../../library/dataclasses.rst:191 +#: ../../library/dataclasses.rst:192 msgid "" "If a field name is already included in the ``__slots__`` of a base class, it " "will not be included in the generated ``__slots__`` to prevent :ref:" @@ -242,7 +242,7 @@ msgid "" "may be any iterable, but *not* an iterator." msgstr "" -#: ../../library/dataclasses.rst:201 +#: ../../library/dataclasses.rst:202 msgid "" "``weakref_slot``: If true (the default is ``False``), add a slot named " "\"__weakref__\", which is required to make an instance weakref-able. It is " @@ -250,26 +250,26 @@ msgid "" "``slots=True``." msgstr "" -#: ../../library/dataclasses.rst:208 +#: ../../library/dataclasses.rst:209 msgid "" "``field``\\s may optionally specify a default value, using normal Python " "syntax::" msgstr "" -#: ../../library/dataclasses.rst:216 +#: ../../library/dataclasses.rst:217 msgid "" "In this example, both ``a`` and ``b`` will be included in the added :meth:" "`__init__` method, which will be defined as::" msgstr "" -#: ../../library/dataclasses.rst:221 +#: ../../library/dataclasses.rst:222 msgid "" ":exc:`TypeError` will be raised if a field without a default value follows a " "field with a default value. This is true whether this occurs in a single " "class, or as a result of class inheritance." msgstr "" -#: ../../library/dataclasses.rst:227 +#: ../../library/dataclasses.rst:228 msgid "" "For common and simple use cases, no other functionality is required. There " "are, however, some dataclass features that require additional per-field " @@ -278,7 +278,7 @@ msgid "" "function. For example::" msgstr "" -#: ../../library/dataclasses.rst:240 +#: ../../library/dataclasses.rst:241 msgid "" "As shown above, the :const:`MISSING` value is a sentinel object used to " "detect if some parameters are provided by the user. This sentinel is used " @@ -286,18 +286,18 @@ msgid "" "meaning. No code should directly use the :const:`MISSING` value." msgstr "" -#: ../../library/dataclasses.rst:245 +#: ../../library/dataclasses.rst:246 msgid "The parameters to :func:`field` are:" msgstr "" -#: ../../library/dataclasses.rst:247 +#: ../../library/dataclasses.rst:248 msgid "" "``default``: If provided, this will be the default value for this field. " "This is needed because the :meth:`field` call itself replaces the normal " "position of the default value." msgstr "" -#: ../../library/dataclasses.rst:251 +#: ../../library/dataclasses.rst:252 msgid "" "``default_factory``: If provided, it must be a zero-argument callable that " "will be called when a default value is needed for this field. Among other " @@ -306,19 +306,19 @@ msgid "" "``default_factory``." msgstr "" -#: ../../library/dataclasses.rst:257 +#: ../../library/dataclasses.rst:258 msgid "" "``init``: If true (the default), this field is included as a parameter to " "the generated :meth:`__init__` method." msgstr "" -#: ../../library/dataclasses.rst:260 +#: ../../library/dataclasses.rst:261 msgid "" "``repr``: If true (the default), this field is included in the string " "returned by the generated :meth:`__repr__` method." msgstr "" -#: ../../library/dataclasses.rst:263 +#: ../../library/dataclasses.rst:264 msgid "" "``hash``: This can be a bool or ``None``. If true, this field is included " "in the generated :meth:`__hash__` method. If ``None`` (the default), use " @@ -327,7 +327,7 @@ msgid "" "Setting this value to anything other than ``None`` is discouraged." msgstr "" -#: ../../library/dataclasses.rst:270 +#: ../../library/dataclasses.rst:271 msgid "" "One possible reason to set ``hash=False`` but ``compare=True`` would be if a " "field is expensive to compute a hash value for, that field is needed for " @@ -336,13 +336,13 @@ msgid "" "used for comparisons." msgstr "" -#: ../../library/dataclasses.rst:276 +#: ../../library/dataclasses.rst:277 msgid "" "``compare``: If true (the default), this field is included in the generated " "equality and comparison methods (:meth:`__eq__`, :meth:`__gt__`, et al.)." msgstr "" -#: ../../library/dataclasses.rst:280 +#: ../../library/dataclasses.rst:281 msgid "" "``metadata``: This can be a mapping or None. None is treated as an empty " "dict. This value is wrapped in :func:`~types.MappingProxyType` to make it " @@ -352,13 +352,13 @@ msgid "" "the metadata." msgstr "" -#: ../../library/dataclasses.rst:288 +#: ../../library/dataclasses.rst:289 msgid "" "``kw_only``: If true, this field will be marked as keyword-only. This is " "used when the generated :meth:`__init__` method's parameters are computed." msgstr "" -#: ../../library/dataclasses.rst:294 +#: ../../library/dataclasses.rst:295 msgid "" "If the default value of a field is specified by a call to :func:`field()`, " "then the class attribute for this field will be replaced by the specified " @@ -369,13 +369,13 @@ msgid "" "after::" msgstr "" -#: ../../library/dataclasses.rst:310 +#: ../../library/dataclasses.rst:311 msgid "" "The class attribute ``C.z`` will be ``10``, the class attribute ``C.t`` will " "be ``20``, and the class attributes ``C.x`` and ``C.y`` will not be set." msgstr "" -#: ../../library/dataclasses.rst:316 +#: ../../library/dataclasses.rst:317 msgid "" ":class:`Field` objects describe each defined field. These objects are " "created internally, and are returned by the :func:`fields` module-level " @@ -383,28 +383,28 @@ msgid "" "directly. Its documented attributes are:" msgstr "" -#: ../../library/dataclasses.rst:321 +#: ../../library/dataclasses.rst:322 msgid "``name``: The name of the field." msgstr "" -#: ../../library/dataclasses.rst:323 +#: ../../library/dataclasses.rst:324 msgid "``type``: The type of the field." msgstr "" -#: ../../library/dataclasses.rst:325 +#: ../../library/dataclasses.rst:326 msgid "" "``default``, ``default_factory``, ``init``, ``repr``, ``hash``, ``compare``, " "``metadata``, and ``kw_only`` have the identical meaning and values as they " "do in the :func:`field` function." msgstr "" -#: ../../library/dataclasses.rst:329 +#: ../../library/dataclasses.rst:330 msgid "" "Other attributes may exist, but they are private and must not be inspected " "or relied on." msgstr "" -#: ../../library/dataclasses.rst:334 +#: ../../library/dataclasses.rst:335 msgid "" "Returns a tuple of :class:`Field` objects that define the fields for this " "dataclass. Accepts either a dataclass, or an instance of a dataclass. " @@ -412,7 +412,7 @@ msgid "" "not return pseudo-fields which are ``ClassVar`` or ``InitVar``." msgstr "" -#: ../../library/dataclasses.rst:341 +#: ../../library/dataclasses.rst:342 msgid "" "Converts the dataclass ``obj`` to a dict (by using the factory function " "``dict_factory``). Each dataclass is converted to a dict of its fields, as " @@ -420,21 +420,21 @@ msgid "" "into. Other objects are copied with :func:`copy.deepcopy`." msgstr "" -#: ../../library/dataclasses.rst:347 +#: ../../library/dataclasses.rst:348 msgid "Example of using :func:`asdict` on nested dataclasses::" msgstr "" -#: ../../library/dataclasses.rst:364 ../../library/dataclasses.rst:384 +#: ../../library/dataclasses.rst:365 ../../library/dataclasses.rst:385 msgid "To create a shallow copy, the following workaround may be used::" msgstr "" -#: ../../library/dataclasses.rst:368 +#: ../../library/dataclasses.rst:369 msgid "" ":func:`asdict` raises :exc:`TypeError` if ``obj`` is not a dataclass " "instance." msgstr "" -#: ../../library/dataclasses.rst:373 +#: ../../library/dataclasses.rst:374 msgid "" "Converts the dataclass ``obj`` to a tuple (by using the factory function " "``tuple_factory``). Each dataclass is converted to a tuple of its field " @@ -442,17 +442,17 @@ msgid "" "objects are copied with :func:`copy.deepcopy`." msgstr "" -#: ../../library/dataclasses.rst:379 +#: ../../library/dataclasses.rst:380 msgid "Continuing from the previous example::" msgstr "" -#: ../../library/dataclasses.rst:388 +#: ../../library/dataclasses.rst:389 msgid "" ":func:`astuple` raises :exc:`TypeError` if ``obj`` is not a dataclass " "instance." msgstr "" -#: ../../library/dataclasses.rst:393 +#: ../../library/dataclasses.rst:394 msgid "" "Creates a new dataclass with name ``cls_name``, fields as defined in " "``fields``, base classes as given in ``bases``, and initialized with a " @@ -464,7 +464,7 @@ msgid "" "``weakref_slot`` have the same meaning as they do in :func:`dataclass`." msgstr "" -#: ../../library/dataclasses.rst:403 +#: ../../library/dataclasses.rst:404 msgid "" "This function is not strictly required, because any Python mechanism for " "creating a new class with ``__annotations__`` can then apply the :func:" @@ -472,11 +472,11 @@ msgid "" "provided as a convenience. For example::" msgstr "" -#: ../../library/dataclasses.rst:415 +#: ../../library/dataclasses.rst:416 msgid "Is equivalent to::" msgstr "" -#: ../../library/dataclasses.rst:428 +#: ../../library/dataclasses.rst:429 msgid "" "Creates a new object of the same type as ``obj``, replacing fields with " "values from ``changes``. If ``obj`` is not a Data Class, raises :exc:" @@ -484,27 +484,27 @@ msgid "" "`TypeError`." msgstr "" -#: ../../library/dataclasses.rst:433 +#: ../../library/dataclasses.rst:434 msgid "" "The newly returned object is created by calling the :meth:`__init__` method " "of the dataclass. This ensures that :meth:`__post_init__`, if present, is " "also called." msgstr "" -#: ../../library/dataclasses.rst:437 +#: ../../library/dataclasses.rst:438 msgid "" "Init-only variables without default values, if any exist, must be specified " "on the call to :func:`replace` so that they can be passed to :meth:" "`__init__` and :meth:`__post_init__`." msgstr "" -#: ../../library/dataclasses.rst:441 +#: ../../library/dataclasses.rst:442 msgid "" "It is an error for ``changes`` to contain any fields that are defined as " "having ``init=False``. A :exc:`ValueError` will be raised in this case." msgstr "" -#: ../../library/dataclasses.rst:445 +#: ../../library/dataclasses.rst:446 msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:" "`replace`. They are not copied from the source object, but rather are " @@ -515,24 +515,24 @@ msgid "" "instance copying." msgstr "" -#: ../../library/dataclasses.rst:456 +#: ../../library/dataclasses.rst:457 msgid "" "Return ``True`` if its parameter is a dataclass or an instance of one, " "otherwise return ``False``." msgstr "" -#: ../../library/dataclasses.rst:459 +#: ../../library/dataclasses.rst:460 msgid "" "If you need to know if a class is an instance of a dataclass (and not a " "dataclass itself), then add a further check for ``not isinstance(obj, " "type)``::" msgstr "" -#: ../../library/dataclasses.rst:468 +#: ../../library/dataclasses.rst:469 msgid "A sentinel value signifying a missing default or default_factory." msgstr "" -#: ../../library/dataclasses.rst:472 +#: ../../library/dataclasses.rst:473 msgid "" "A sentinel value used as a type annotation. Any fields after a pseudo-field " "with the type of :const:`KW_ONLY` are marked as keyword-only fields. Note " @@ -543,30 +543,30 @@ msgid "" "is instantiated." msgstr "" -#: ../../library/dataclasses.rst:481 +#: ../../library/dataclasses.rst:482 msgid "" "In this example, the fields ``y`` and ``z`` will be marked as keyword-only " "fields::" msgstr "" -#: ../../library/dataclasses.rst:492 +#: ../../library/dataclasses.rst:493 msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`KW_ONLY`." msgstr "" -#: ../../library/dataclasses.rst:499 +#: ../../library/dataclasses.rst:500 msgid "" "Raised when an implicitly defined :meth:`__setattr__` or :meth:`__delattr__` " "is called on a dataclass which was defined with ``frozen=True``. It is a " "subclass of :exc:`AttributeError`." msgstr "" -#: ../../library/dataclasses.rst:504 +#: ../../library/dataclasses.rst:505 msgid "Post-init processing" msgstr "" -#: ../../library/dataclasses.rst:506 +#: ../../library/dataclasses.rst:507 msgid "" "The generated :meth:`__init__` code will call a method named :meth:" "`__post_init__`, if :meth:`__post_init__` is defined on the class. It will " @@ -576,13 +576,13 @@ msgid "" "generated, then :meth:`__post_init__` will not automatically be called." msgstr "" -#: ../../library/dataclasses.rst:514 +#: ../../library/dataclasses.rst:515 msgid "" "Among other uses, this allows for initializing field values that depend on " "one or more other fields. For example::" msgstr "" -#: ../../library/dataclasses.rst:526 +#: ../../library/dataclasses.rst:527 msgid "" "The :meth:`__init__` method generated by :func:`dataclass` does not call " "base class :meth:`__init__` methods. If the base class has an :meth:" @@ -590,25 +590,25 @@ msgid "" "a :meth:`__post_init__` method::" msgstr "" -#: ../../library/dataclasses.rst:543 +#: ../../library/dataclasses.rst:544 msgid "" "Note, however, that in general the dataclass-generated :meth:`__init__` " "methods don't need to be called, since the derived dataclass will take care " "of initializing all fields of any base class that is a dataclass itself." msgstr "" -#: ../../library/dataclasses.rst:547 +#: ../../library/dataclasses.rst:548 msgid "" "See the section below on init-only variables for ways to pass parameters to :" "meth:`__post_init__`. Also see the warning about how :func:`replace` " "handles ``init=False`` fields." msgstr "" -#: ../../library/dataclasses.rst:552 +#: ../../library/dataclasses.rst:553 msgid "Class variables" msgstr "" -#: ../../library/dataclasses.rst:554 +#: ../../library/dataclasses.rst:555 msgid "" "One of two places where :func:`dataclass` actually inspects the type of a " "field is to determine if a field is a class variable as defined in :pep:" @@ -618,11 +618,11 @@ msgid "" "pseudo-fields are not returned by the module-level :func:`fields` function." msgstr "" -#: ../../library/dataclasses.rst:563 +#: ../../library/dataclasses.rst:564 msgid "Init-only variables" msgstr "" -#: ../../library/dataclasses.rst:565 +#: ../../library/dataclasses.rst:566 msgid "" "The other place where :func:`dataclass` inspects a type annotation is to " "determine if a field is an init-only variable. It does this by seeing if " @@ -634,23 +634,23 @@ msgid "" "`__post_init__` method. They are not otherwise used by dataclasses." msgstr "" -#: ../../library/dataclasses.rst:575 +#: ../../library/dataclasses.rst:576 msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "" -#: ../../library/dataclasses.rst:590 +#: ../../library/dataclasses.rst:591 msgid "" "In this case, :func:`fields` will return :class:`Field` objects for ``i`` " "and ``j``, but not for ``database``." msgstr "" -#: ../../library/dataclasses.rst:594 +#: ../../library/dataclasses.rst:595 msgid "Frozen instances" msgstr "" -#: ../../library/dataclasses.rst:596 +#: ../../library/dataclasses.rst:597 msgid "" "It is not possible to create truly immutable Python objects. However, by " "passing ``frozen=True`` to the :meth:`dataclass` decorator you can emulate " @@ -659,18 +659,18 @@ msgid "" "`FrozenInstanceError` when invoked." msgstr "" -#: ../../library/dataclasses.rst:602 +#: ../../library/dataclasses.rst:603 msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" "`__init__` cannot use simple assignment to initialize fields, and must use :" "meth:`object.__setattr__`." msgstr "" -#: ../../library/dataclasses.rst:607 +#: ../../library/dataclasses.rst:608 msgid "Inheritance" msgstr "" -#: ../../library/dataclasses.rst:609 +#: ../../library/dataclasses.rst:610 msgid "" "When the dataclass is being created by the :meth:`dataclass` decorator, it " "looks through all of the class's base classes in reverse MRO (that is, " @@ -682,21 +682,21 @@ msgid "" "derived classes override base classes. An example::" msgstr "" -#: ../../library/dataclasses.rst:629 +#: ../../library/dataclasses.rst:630 msgid "" "The final list of fields is, in order, ``x``, ``y``, ``z``. The final type " "of ``x`` is ``int``, as specified in class ``C``." msgstr "" -#: ../../library/dataclasses.rst:632 +#: ../../library/dataclasses.rst:633 msgid "The generated :meth:`__init__` method for ``C`` will look like::" msgstr "" -#: ../../library/dataclasses.rst:637 +#: ../../library/dataclasses.rst:638 msgid "Re-ordering of keyword-only parameters in :meth:`__init__`" msgstr "" -#: ../../library/dataclasses.rst:639 +#: ../../library/dataclasses.rst:640 msgid "" "After the parameters needed for :meth:`__init__` are computed, any keyword-" "only parameters are moved to come after all regular (non-keyword-only) " @@ -704,41 +704,41 @@ msgid "" "implemented in Python: they must come after non-keyword-only parameters." msgstr "" -#: ../../library/dataclasses.rst:645 +#: ../../library/dataclasses.rst:646 msgid "" "In this example, ``Base.y``, ``Base.w``, and ``D.t`` are keyword-only " "fields, and ``Base.x`` and ``D.z`` are regular fields::" msgstr "" -#: ../../library/dataclasses.rst:660 +#: ../../library/dataclasses.rst:661 msgid "The generated :meth:`__init__` method for ``D`` will look like::" msgstr "" -#: ../../library/dataclasses.rst:664 +#: ../../library/dataclasses.rst:665 msgid "" "Note that the parameters have been re-ordered from how they appear in the " "list of fields: parameters derived from regular fields are followed by " "parameters derived from keyword-only fields." msgstr "" -#: ../../library/dataclasses.rst:668 +#: ../../library/dataclasses.rst:669 msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`__init__` parameter list." msgstr "" -#: ../../library/dataclasses.rst:673 +#: ../../library/dataclasses.rst:674 msgid "Default factory functions" msgstr "" -#: ../../library/dataclasses.rst:675 +#: ../../library/dataclasses.rst:676 msgid "" "If a :func:`field` specifies a ``default_factory``, it is called with zero " "arguments when a default value for the field is needed. For example, to " "create a new instance of a list, use::" msgstr "" -#: ../../library/dataclasses.rst:681 +#: ../../library/dataclasses.rst:682 msgid "" "If a field is excluded from :meth:`__init__` (using ``init=False``) and the " "field also specifies ``default_factory``, then the default factory function " @@ -746,31 +746,31 @@ msgid "" "happens because there is no other way to give the field an initial value." msgstr "" -#: ../../library/dataclasses.rst:688 +#: ../../library/dataclasses.rst:689 msgid "Mutable default values" msgstr "" -#: ../../library/dataclasses.rst:690 +#: ../../library/dataclasses.rst:691 msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" msgstr "" -#: ../../library/dataclasses.rst:705 +#: ../../library/dataclasses.rst:706 msgid "" "Note that the two instances of class ``C`` share the same class variable " "``x``, as expected." msgstr "" -#: ../../library/dataclasses.rst:708 +#: ../../library/dataclasses.rst:709 msgid "Using dataclasses, *if* this code was valid::" msgstr "" -#: ../../library/dataclasses.rst:716 +#: ../../library/dataclasses.rst:717 msgid "it would generate code similar to::" msgstr "" -#: ../../library/dataclasses.rst:727 +#: ../../library/dataclasses.rst:728 msgid "" "This has the same issue as the original example using class ``C``. That is, " "two instances of class ``D`` that do not specify a value for ``x`` when " @@ -783,44 +783,44 @@ msgid "" "solution, but it does protect against many common errors." msgstr "" -#: ../../library/dataclasses.rst:738 +#: ../../library/dataclasses.rst:739 msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "" -#: ../../library/dataclasses.rst:747 +#: ../../library/dataclasses.rst:748 msgid "" "Instead of looking for and disallowing objects of type ``list``, ``dict``, " "or ``set``, unhashable objects are now not allowed as default values. " "Unhashability is used to approximate mutability." msgstr "" -#: ../../library/dataclasses.rst:754 +#: ../../library/dataclasses.rst:755 msgid "Descriptor-typed fields" msgstr "" -#: ../../library/dataclasses.rst:756 +#: ../../library/dataclasses.rst:757 msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " "default value have the following special behaviors:" msgstr "" -#: ../../library/dataclasses.rst:759 +#: ../../library/dataclasses.rst:760 msgid "" "The value for the field passed to the dataclass's ``__init__`` method is " "passed to the descriptor's ``__set__`` method rather than overwriting the " "descriptor object." msgstr "" -#: ../../library/dataclasses.rst:762 +#: ../../library/dataclasses.rst:763 msgid "" "Similarly, when getting or setting the field, the descriptor's ``__get__`` " "or ``__set__`` method is called rather than returning or overwriting the " "descriptor object." msgstr "" -#: ../../library/dataclasses.rst:765 +#: ../../library/dataclasses.rst:766 msgid "" "To determine whether a field contains a default value, ``dataclasses`` will " "call the descriptor's ``__get__`` method using its class access form (i.e. " @@ -830,7 +830,7 @@ msgid "" "default value will be provided for the field." msgstr "" -#: ../../library/dataclasses.rst:800 +#: ../../library/dataclasses.rst:801 msgid "" "Note that if a field is annotated with a descriptor type, but is not " "assigned a descriptor object as its default value, the field will act like a " diff --git a/library/enum.po b/library/enum.po index 9a268338936..35b95fd7f1f 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-12 20:01+0000\n" +"POT-Creation-Date: 2022-12-06 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -884,27 +884,33 @@ msgid "" "create the ``THREE`` enum member)" msgstr "" -#: ../../library/enum.rst:814 +#: ../../library/enum.rst:816 +msgid "" +"In prior versions, ``auto()`` had to be the only thing on the assignment " +"line to work properly." +msgstr "" + +#: ../../library/enum.rst:819 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "" -#: ../../library/enum.rst:817 +#: ../../library/enum.rst:822 msgid "" "in 3.13 the default ``\"generate_next_value_`` will always return the " "highest member value incremented by 1, and will fail if any member is an " "incompatible type." msgstr "" -#: ../../library/enum.rst:823 +#: ../../library/enum.rst:828 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " "themselves." msgstr "" -#: ../../library/enum.rst:827 +#: ../../library/enum.rst:832 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -912,29 +918,29 @@ msgid "" "``name``." msgstr "" -#: ../../library/enum.rst:836 +#: ../../library/enum.rst:841 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`__members__`, gathering any aliases it finds; if any " "are found :exc:`ValueError` is raised with the details::" msgstr "" -#: ../../library/enum.rst:854 +#: ../../library/enum.rst:859 msgid "" "A :keyword:`class` decorator specifically for enumerations. Members from :" "class:`EnumCheck` are used to specify which constraints should be checked on " "the decorated enumeration." msgstr "" -#: ../../library/enum.rst:862 +#: ../../library/enum.rst:867 msgid "A decorator for use in enums: its target will become a member." msgstr "" -#: ../../library/enum.rst:868 +#: ../../library/enum.rst:873 msgid "A decorator for use in enums: its target will not become a member." msgstr "" -#: ../../library/enum.rst:874 +#: ../../library/enum.rst:879 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -942,41 +948,41 @@ msgid "" "namespace (see :class:`re.RegexFlag` for an example)." msgstr "" -#: ../../library/enum.rst:884 +#: ../../library/enum.rst:889 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "" -#: ../../library/enum.rst:891 +#: ../../library/enum.rst:896 msgid "Notes" msgstr "" -#: ../../library/enum.rst:893 +#: ../../library/enum.rst:898 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr "" -#: ../../library/enum.rst:895 +#: ../../library/enum.rst:900 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" msgstr "" -#: ../../library/enum.rst:898 +#: ../../library/enum.rst:903 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "" -#: ../../library/enum.rst:900 +#: ../../library/enum.rst:905 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "" -#: ../../library/enum.rst:903 +#: ../../library/enum.rst:908 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" msgstr "" -#: ../../library/enum.rst:910 +#: ../../library/enum.rst:915 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "" diff --git a/library/http.server.po b/library/http.server.po index cf44f1d9bf8..12d0b9bb8e9 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-12-06 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -239,8 +239,8 @@ msgstr "" #: ../../library/http.server.rst:195 msgid "" -"This method will parse and dispatch the request to the appropriate :meth:`do_" -"\\*` method. You should never need to override it." +"This method will parse and dispatch the request to the appropriate :meth:" +"`do_\\*` method. You should never need to override it." msgstr "" #: ../../library/http.server.rst:200 @@ -621,3 +621,12 @@ msgid "" "requests, this makes it possible for files outside of the specified " "directory to be served." msgstr "" + +#: ../../library/http.server.rst:516 +msgid "" +"Earlier versions of Python did not scrub control characters from the log " +"messages emitted to stderr from ``python -m http.server`` or the default :" +"class:`BaseHTTPRequestHandler` ``.log_message`` implementation. This could " +"allow to remote clients connecting to your server to send nefarious control " +"codes to your terminal." +msgstr "" From 78a16d18f9537fdf26fd6231fbfb59f4900d0b54 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 7 Dec 2022 00:19:58 +0000 Subject: [PATCH 04/11] sync with cpython fbc3e1ed --- library/asyncio-eventloop.po | 824 +++++++++++++++++---------------- library/asyncio-llapi-index.po | 8 +- library/asyncio-policy.po | 89 ++-- library/enum.po | 18 +- library/http.server.po | 8 +- 5 files changed, 484 insertions(+), 463 deletions(-) diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 8037feb4465..24497cba2ff 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-05 00:16+0000\n" +"POT-Creation-Date: 2022-12-07 00:17+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -79,117 +79,127 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:46 msgid "" -"If there is no current event loop set in the current OS thread, the OS " -"thread is main, and :func:`set_event_loop` has not yet been called, asyncio " -"will create a new event loop and set it as the current one." +"When called from a coroutine or a callback (e.g. scheduled with call_soon or " +"similar API), this function will always return the running event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:51 +#: ../../library/asyncio-eventloop.rst:50 +msgid "" +"If there is no running event loop set, the function will return the result " +"of ``get_event_loop_policy().get_event_loop()`` call." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:53 msgid "" "Because this function has rather complex behavior (especially when custom " "event loop policies are in use), using the :func:`get_running_loop` function " "is preferred to :func:`get_event_loop` in coroutines and callbacks." msgstr "" -#: ../../library/asyncio-eventloop.rst:56 +#: ../../library/asyncio-eventloop.rst:58 msgid "" "As noted above, consider using the higher-level :func:`asyncio.run` " "function, instead of using these lower level functions to manually create " "and close an event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:60 +#: ../../library/asyncio-eventloop.rst:62 +msgid "" +"Deprecation warning is emitted if there is no current event loop. In Python " +"3.12 it will be an error." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:67 msgid "" -"Emits a deprecation warning if there is no running event loop. In future " -"Python releases, this function may become an alias of :func:" -"`get_running_loop` and will accordingly raise a :exc:`RuntimeError` if there " -"is no running event loop." +"In Python versions 3.10.0--3.10.8 and 3.11.0 this function (and other " +"functions which used it implicitly) emitted a :exc:`DeprecationWarning` if " +"there was no running event loop, even if the current loop was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:68 +#: ../../library/asyncio-eventloop.rst:74 msgid "Set *loop* as the current event loop for the current OS thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:72 +#: ../../library/asyncio-eventloop.rst:78 msgid "Create and return a new event loop object." msgstr "" -#: ../../library/asyncio-eventloop.rst:74 +#: ../../library/asyncio-eventloop.rst:80 msgid "" "Note that the behaviour of :func:`get_event_loop`, :func:`set_event_loop`, " "and :func:`new_event_loop` functions can be altered by :ref:`setting a " "custom event loop policy `." msgstr "" -#: ../../library/asyncio-eventloop.rst:80 +#: ../../library/asyncio-eventloop.rst:86 msgid "Contents" msgstr "目錄" -#: ../../library/asyncio-eventloop.rst:81 +#: ../../library/asyncio-eventloop.rst:87 msgid "This documentation page contains the following sections:" msgstr "" -#: ../../library/asyncio-eventloop.rst:83 +#: ../../library/asyncio-eventloop.rst:89 msgid "" "The `Event Loop Methods`_ section is the reference documentation of the " "event loop APIs;" msgstr "" -#: ../../library/asyncio-eventloop.rst:86 +#: ../../library/asyncio-eventloop.rst:92 msgid "" "The `Callback Handles`_ section documents the :class:`Handle` and :class:" "`TimerHandle` instances which are returned from scheduling methods such as :" "meth:`loop.call_soon` and :meth:`loop.call_later`;" msgstr "" -#: ../../library/asyncio-eventloop.rst:90 +#: ../../library/asyncio-eventloop.rst:96 msgid "" "The `Server Objects`_ section documents types returned from event loop " "methods like :meth:`loop.create_server`;" msgstr "" -#: ../../library/asyncio-eventloop.rst:93 +#: ../../library/asyncio-eventloop.rst:99 msgid "" "The `Event Loop Implementations`_ section documents the :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" msgstr "" -#: ../../library/asyncio-eventloop.rst:96 +#: ../../library/asyncio-eventloop.rst:102 msgid "" "The `Examples`_ section showcases how to work with some event loop APIs." msgstr "" -#: ../../library/asyncio-eventloop.rst:103 +#: ../../library/asyncio-eventloop.rst:109 msgid "Event Loop Methods" msgstr "" -#: ../../library/asyncio-eventloop.rst:105 +#: ../../library/asyncio-eventloop.rst:111 msgid "Event loops have **low-level** APIs for the following:" msgstr "" -#: ../../library/asyncio-eventloop.rst:113 +#: ../../library/asyncio-eventloop.rst:119 msgid "Running and stopping the loop" msgstr "" -#: ../../library/asyncio-eventloop.rst:117 +#: ../../library/asyncio-eventloop.rst:123 msgid "Run until the *future* (an instance of :class:`Future`) has completed." msgstr "" -#: ../../library/asyncio-eventloop.rst:120 +#: ../../library/asyncio-eventloop.rst:126 msgid "" "If the argument is a :ref:`coroutine object ` it is implicitly " "scheduled to run as a :class:`asyncio.Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:123 +#: ../../library/asyncio-eventloop.rst:129 msgid "Return the Future's result or raise its exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:127 +#: ../../library/asyncio-eventloop.rst:133 msgid "Run the event loop until :meth:`stop` is called." msgstr "" -#: ../../library/asyncio-eventloop.rst:129 +#: ../../library/asyncio-eventloop.rst:135 msgid "" "If :meth:`stop` is called before :meth:`run_forever()` is called, the loop " "will poll the I/O selector once with a timeout of zero, run all callbacks " @@ -197,7 +207,7 @@ msgid "" "and then exit." msgstr "" -#: ../../library/asyncio-eventloop.rst:134 +#: ../../library/asyncio-eventloop.rst:140 msgid "" "If :meth:`stop` is called while :meth:`run_forever` is running, the loop " "will run the current batch of callbacks and then exit. Note that new " @@ -206,41 +216,41 @@ msgid "" "called." msgstr "" -#: ../../library/asyncio-eventloop.rst:142 +#: ../../library/asyncio-eventloop.rst:148 msgid "Stop the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:146 +#: ../../library/asyncio-eventloop.rst:152 msgid "Return ``True`` if the event loop is currently running." msgstr "" -#: ../../library/asyncio-eventloop.rst:150 +#: ../../library/asyncio-eventloop.rst:156 msgid "Return ``True`` if the event loop was closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:154 +#: ../../library/asyncio-eventloop.rst:160 msgid "Close the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:156 +#: ../../library/asyncio-eventloop.rst:162 msgid "" "The loop must not be running when this function is called. Any pending " "callbacks will be discarded." msgstr "" -#: ../../library/asyncio-eventloop.rst:159 +#: ../../library/asyncio-eventloop.rst:165 msgid "" "This method clears all queues and shuts down the executor, but does not wait " "for the executor to finish." msgstr "" -#: ../../library/asyncio-eventloop.rst:162 +#: ../../library/asyncio-eventloop.rst:168 msgid "" "This method is idempotent and irreversible. No other methods should be " "called after the event loop is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:167 +#: ../../library/asyncio-eventloop.rst:173 msgid "" "Schedule all currently open :term:`asynchronous generator` objects to close " "with an :meth:`~agen.aclose()` call. After calling this method, the event " @@ -248,23 +258,23 @@ msgid "" "should be used to reliably finalize all scheduled asynchronous generators." msgstr "" -#: ../../library/asyncio-eventloop.rst:173 -#: ../../library/asyncio-eventloop.rst:193 +#: ../../library/asyncio-eventloop.rst:179 +#: ../../library/asyncio-eventloop.rst:199 msgid "" "Note that there is no need to call this function when :func:`asyncio.run` is " "used." msgstr "" -#: ../../library/asyncio-eventloop.rst:176 -#: ../../library/asyncio-eventloop.rst:1204 -#: ../../library/asyncio-eventloop.rst:1592 +#: ../../library/asyncio-eventloop.rst:182 +#: ../../library/asyncio-eventloop.rst:1210 +#: ../../library/asyncio-eventloop.rst:1598 msgid "Example::" msgstr "" "範例:\n" "\n" "::" -#: ../../library/asyncio-eventloop.rst:188 +#: ../../library/asyncio-eventloop.rst:194 msgid "" "Schedule the closure of the default executor and wait for it to join all of " "the threads in the :class:`ThreadPoolExecutor`. After calling this method, " @@ -272,207 +282,207 @@ msgid "" "called while using the default executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:200 +#: ../../library/asyncio-eventloop.rst:206 msgid "Scheduling callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:204 +#: ../../library/asyncio-eventloop.rst:210 msgid "" "Schedule the *callback* :term:`callback` to be called with *args* arguments " "at the next iteration of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:207 +#: ../../library/asyncio-eventloop.rst:213 msgid "" "Callbacks are called in the order in which they are registered. Each " "callback will be called exactly once." msgstr "" -#: ../../library/asyncio-eventloop.rst:210 -#: ../../library/asyncio-eventloop.rst:277 +#: ../../library/asyncio-eventloop.rst:216 +#: ../../library/asyncio-eventloop.rst:283 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *callback* to run in. The current " "context is used when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:214 +#: ../../library/asyncio-eventloop.rst:220 msgid "" "An instance of :class:`asyncio.Handle` is returned, which can be used later " "to cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:217 +#: ../../library/asyncio-eventloop.rst:223 msgid "This method is not thread-safe." msgstr "" -#: ../../library/asyncio-eventloop.rst:221 +#: ../../library/asyncio-eventloop.rst:227 msgid "" "A thread-safe variant of :meth:`call_soon`. Must be used to schedule " "callbacks *from another thread*." msgstr "" -#: ../../library/asyncio-eventloop.rst:224 +#: ../../library/asyncio-eventloop.rst:230 msgid "" "Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " "happen on a secondary thread when the main application is shutting down." msgstr "" -#: ../../library/asyncio-eventloop.rst:228 +#: ../../library/asyncio-eventloop.rst:234 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-eventloop.rst:231 -#: ../../library/asyncio-eventloop.rst:281 -#: ../../library/asyncio-eventloop.rst:301 +#: ../../library/asyncio-eventloop.rst:237 +#: ../../library/asyncio-eventloop.rst:287 +#: ../../library/asyncio-eventloop.rst:307 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." msgstr "" -#: ../../library/asyncio-eventloop.rst:239 +#: ../../library/asyncio-eventloop.rst:245 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" msgstr "" -#: ../../library/asyncio-eventloop.rst:246 +#: ../../library/asyncio-eventloop.rst:252 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." msgstr "" -#: ../../library/asyncio-eventloop.rst:254 +#: ../../library/asyncio-eventloop.rst:260 msgid "Scheduling delayed callbacks" msgstr "" -#: ../../library/asyncio-eventloop.rst:256 +#: ../../library/asyncio-eventloop.rst:262 msgid "" "Event loop provides mechanisms to schedule callback functions to be called " "at some point in the future. Event loop uses monotonic clocks to track time." msgstr "" -#: ../../library/asyncio-eventloop.rst:263 +#: ../../library/asyncio-eventloop.rst:269 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." msgstr "" -#: ../../library/asyncio-eventloop.rst:266 -#: ../../library/asyncio-eventloop.rst:298 +#: ../../library/asyncio-eventloop.rst:272 +#: ../../library/asyncio-eventloop.rst:304 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." msgstr "" -#: ../../library/asyncio-eventloop.rst:269 +#: ../../library/asyncio-eventloop.rst:275 msgid "" "*callback* will be called exactly once. If two callbacks are scheduled for " "exactly the same time, the order in which they are called is undefined." msgstr "" -#: ../../library/asyncio-eventloop.rst:273 +#: ../../library/asyncio-eventloop.rst:279 msgid "" "The optional positional *args* will be passed to the callback when it is " "called. If you want the callback to be called with keyword arguments use :" "func:`functools.partial`." msgstr "" -#: ../../library/asyncio-eventloop.rst:285 +#: ../../library/asyncio-eventloop.rst:291 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "*delay* could not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:292 +#: ../../library/asyncio-eventloop.rst:298 msgid "" "Schedule *callback* to be called at the given absolute timestamp *when* (an " "int or a float), using the same time reference as :meth:`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:296 +#: ../../library/asyncio-eventloop.rst:302 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "" -#: ../../library/asyncio-eventloop.rst:305 +#: ../../library/asyncio-eventloop.rst:311 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "difference between *when* and the current time could not exceed one day. " "This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:312 +#: ../../library/asyncio-eventloop.rst:318 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." msgstr "" -#: ../../library/asyncio-eventloop.rst:316 +#: ../../library/asyncio-eventloop.rst:322 msgid "" "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " "should not exceed one day. This has been fixed in Python 3.8." msgstr "" -#: ../../library/asyncio-eventloop.rst:322 +#: ../../library/asyncio-eventloop.rst:328 msgid "The :func:`asyncio.sleep` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:326 +#: ../../library/asyncio-eventloop.rst:332 msgid "Creating Futures and Tasks" msgstr "" -#: ../../library/asyncio-eventloop.rst:330 +#: ../../library/asyncio-eventloop.rst:336 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:332 +#: ../../library/asyncio-eventloop.rst:338 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " "(with better performance or instrumentation)." msgstr "" -#: ../../library/asyncio-eventloop.rst:340 +#: ../../library/asyncio-eventloop.rst:346 msgid "" "Schedule the execution of :ref:`coroutine ` *coro*. Return a :" "class:`Task` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:343 +#: ../../library/asyncio-eventloop.rst:349 msgid "" "Third-party event loops can use their own subclass of :class:`Task` for " "interoperability. In this case, the result type is a subclass of :class:" "`Task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:347 +#: ../../library/asyncio-eventloop.rst:353 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." msgstr "" -#: ../../library/asyncio-eventloop.rst:350 +#: ../../library/asyncio-eventloop.rst:356 msgid "" "An optional keyword-only *context* argument allows specifying a custom :" "class:`contextvars.Context` for the *coro* to run in. The current context " "copy is created when no *context* is provided." msgstr "" -#: ../../library/asyncio-eventloop.rst:354 +#: ../../library/asyncio-eventloop.rst:360 msgid "Added the *name* parameter." msgstr "加入 *name* 參數。" -#: ../../library/asyncio-eventloop.rst:357 +#: ../../library/asyncio-eventloop.rst:363 msgid "Added the *context* parameter." msgstr "加入 *context* 參數。" -#: ../../library/asyncio-eventloop.rst:362 +#: ../../library/asyncio-eventloop.rst:368 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr "" -#: ../../library/asyncio-eventloop.rst:365 +#: ../../library/asyncio-eventloop.rst:371 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " "*factory* must be a *callable* with the signature matching ``(loop, coro, " @@ -481,82 +491,82 @@ msgid "" "Future`-compatible object." msgstr "" -#: ../../library/asyncio-eventloop.rst:373 +#: ../../library/asyncio-eventloop.rst:379 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "" -#: ../../library/asyncio-eventloop.rst:377 +#: ../../library/asyncio-eventloop.rst:383 msgid "Opening network connections" msgstr "" -#: ../../library/asyncio-eventloop.rst:387 +#: ../../library/asyncio-eventloop.rst:393 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:390 +#: ../../library/asyncio-eventloop.rst:396 msgid "" "The socket family can be either :py:data:`~socket.AF_INET` or :py:data:" "`~socket.AF_INET6` depending on *host* (or the *family* argument, if " "provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:394 +#: ../../library/asyncio-eventloop.rst:400 msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:396 -#: ../../library/asyncio-eventloop.rst:1120 -#: ../../library/asyncio-eventloop.rst:1136 +#: ../../library/asyncio-eventloop.rst:402 +#: ../../library/asyncio-eventloop.rst:1126 +#: ../../library/asyncio-eventloop.rst:1142 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:399 +#: ../../library/asyncio-eventloop.rst:405 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:402 +#: ../../library/asyncio-eventloop.rst:408 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "" -#: ../../library/asyncio-eventloop.rst:404 +#: ../../library/asyncio-eventloop.rst:410 msgid "" "The connection is established and a :ref:`transport ` is " "created for it." msgstr "" -#: ../../library/asyncio-eventloop.rst:407 +#: ../../library/asyncio-eventloop.rst:413 msgid "" "*protocol_factory* is called without arguments and is expected to return a :" "ref:`protocol ` instance." msgstr "" -#: ../../library/asyncio-eventloop.rst:410 +#: ../../library/asyncio-eventloop.rst:416 msgid "" "The protocol instance is coupled with the transport by calling its :meth:" "`~BaseProtocol.connection_made` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:413 +#: ../../library/asyncio-eventloop.rst:419 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:415 +#: ../../library/asyncio-eventloop.rst:421 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "" -#: ../../library/asyncio-eventloop.rst:418 -#: ../../library/asyncio-eventloop.rst:539 +#: ../../library/asyncio-eventloop.rst:424 +#: ../../library/asyncio-eventloop.rst:545 msgid "Other arguments:" msgstr "" -#: ../../library/asyncio-eventloop.rst:420 +#: ../../library/asyncio-eventloop.rst:426 msgid "" "*ssl*: if given and not false, a SSL/TLS transport is created (by default a " "plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " @@ -565,11 +575,11 @@ msgid "" "is used." msgstr "" -#: ../../library/asyncio-eventloop.rst:426 +#: ../../library/asyncio-eventloop.rst:432 msgid ":ref:`SSL/TLS security considerations `" msgstr "" -#: ../../library/asyncio-eventloop.rst:428 +#: ../../library/asyncio-eventloop.rst:434 msgid "" "*server_hostname* sets or overrides the hostname that the target server's " "certificate will be matched against. Should only be passed if *ssl* is not " @@ -580,7 +590,7 @@ msgid "" "potential man-in-the-middle attacks)." msgstr "" -#: ../../library/asyncio-eventloop.rst:436 +#: ../../library/asyncio-eventloop.rst:442 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -588,7 +598,7 @@ msgid "" "constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:441 +#: ../../library/asyncio-eventloop.rst:447 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " @@ -598,7 +608,7 @@ msgid "" "the RFC is ``0.25`` (250 milliseconds)." msgstr "" -#: ../../library/asyncio-eventloop.rst:449 +#: ../../library/asyncio-eventloop.rst:455 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " @@ -609,7 +619,7 @@ msgid "" "*happy_eyeballs_delay* is not specified, and ``1`` if it is." msgstr "" -#: ../../library/asyncio-eventloop.rst:458 +#: ../../library/asyncio-eventloop.rst:464 msgid "" "*sock*, if given, should be an existing, already connected :class:`socket." "socket` object to be used by the transport. If *sock* is given, none of " @@ -617,61 +627,61 @@ msgid "" "*interleave* and *local_addr* should be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:466 -#: ../../library/asyncio-eventloop.rst:570 -#: ../../library/asyncio-eventloop.rst:794 +#: ../../library/asyncio-eventloop.rst:472 +#: ../../library/asyncio-eventloop.rst:576 +#: ../../library/asyncio-eventloop.rst:800 msgid "" "The *sock* argument transfers ownership of the socket to the transport " "created. To close the socket, call the transport's :meth:`~asyncio." "BaseTransport.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:470 +#: ../../library/asyncio-eventloop.rst:476 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using " "``getaddrinfo()``, similarly to *host* and *port*." msgstr "" -#: ../../library/asyncio-eventloop.rst:474 -#: ../../library/asyncio-eventloop.rst:885 +#: ../../library/asyncio-eventloop.rst:480 +#: ../../library/asyncio-eventloop.rst:891 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:478 -#: ../../library/asyncio-eventloop.rst:711 -#: ../../library/asyncio-eventloop.rst:805 -#: ../../library/asyncio-eventloop.rst:889 +#: ../../library/asyncio-eventloop.rst:484 +#: ../../library/asyncio-eventloop.rst:717 +#: ../../library/asyncio-eventloop.rst:811 +#: ../../library/asyncio-eventloop.rst:895 msgid "" "*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " "to complete before aborting the connection. ``30.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:484 -#: ../../library/asyncio-eventloop.rst:723 +#: ../../library/asyncio-eventloop.rst:490 +#: ../../library/asyncio-eventloop.rst:729 msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:488 +#: ../../library/asyncio-eventloop.rst:494 msgid "" "The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " "TCP connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:493 -#: ../../library/asyncio-eventloop.rst:815 +#: ../../library/asyncio-eventloop.rst:499 +#: ../../library/asyncio-eventloop.rst:821 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "增加 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:497 +#: ../../library/asyncio-eventloop.rst:503 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "加入 *happy_eyeballs_delay* 和 *interleave* 參數。" -#: ../../library/asyncio-eventloop.rst:499 +#: ../../library/asyncio-eventloop.rst:505 msgid "" "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " "IPv4 path and protocol are working, but the server's IPv6 path and protocol " @@ -682,69 +692,69 @@ msgid "" "visible delay and provides an algorithm." msgstr "" -#: ../../library/asyncio-eventloop.rst:508 +#: ../../library/asyncio-eventloop.rst:514 msgid "For more information: https://tools.ietf.org/html/rfc6555" msgstr "更多資訊請見:\\ https://tools.ietf.org/html/rfc6555" -#: ../../library/asyncio-eventloop.rst:512 -#: ../../library/asyncio-eventloop.rst:631 -#: ../../library/asyncio-eventloop.rst:737 -#: ../../library/asyncio-eventloop.rst:772 -#: ../../library/asyncio-eventloop.rst:819 -#: ../../library/asyncio-eventloop.rst:897 +#: ../../library/asyncio-eventloop.rst:518 +#: ../../library/asyncio-eventloop.rst:637 +#: ../../library/asyncio-eventloop.rst:743 +#: ../../library/asyncio-eventloop.rst:778 +#: ../../library/asyncio-eventloop.rst:825 +#: ../../library/asyncio-eventloop.rst:903 msgid "Added the *ssl_shutdown_timeout* parameter." msgstr "增加 *ssl_shutdown_timeout* 參數。" -#: ../../library/asyncio-eventloop.rst:516 +#: ../../library/asyncio-eventloop.rst:522 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " "used directly in async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:526 +#: ../../library/asyncio-eventloop.rst:532 msgid "Create a datagram connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:528 +#: ../../library/asyncio-eventloop.rst:534 msgid "" "The socket family can be either :py:data:`~socket.AF_INET`, :py:data:" "`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`, depending on *host* (or " "the *family* argument, if provided)." msgstr "" -#: ../../library/asyncio-eventloop.rst:532 +#: ../../library/asyncio-eventloop.rst:538 msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:534 -#: ../../library/asyncio-eventloop.rst:654 -#: ../../library/asyncio-eventloop.rst:786 +#: ../../library/asyncio-eventloop.rst:540 +#: ../../library/asyncio-eventloop.rst:660 +#: ../../library/asyncio-eventloop.rst:792 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." msgstr "" -#: ../../library/asyncio-eventloop.rst:537 -#: ../../library/asyncio-eventloop.rst:613 +#: ../../library/asyncio-eventloop.rst:543 +#: ../../library/asyncio-eventloop.rst:619 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "" -#: ../../library/asyncio-eventloop.rst:541 +#: ../../library/asyncio-eventloop.rst:547 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using :" "meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:545 +#: ../../library/asyncio-eventloop.rst:551 msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " "connect the socket to a remote address. The *remote_host* and *remote_port* " "are looked up using :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:549 +#: ../../library/asyncio-eventloop.rst:555 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -752,7 +762,7 @@ msgid "" "module constants." msgstr "" -#: ../../library/asyncio-eventloop.rst:554 +#: ../../library/asyncio-eventloop.rst:560 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " @@ -761,13 +771,13 @@ msgid "" "this capability is unsupported." msgstr "" -#: ../../library/asyncio-eventloop.rst:560 +#: ../../library/asyncio-eventloop.rst:566 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." msgstr "" -#: ../../library/asyncio-eventloop.rst:563 +#: ../../library/asyncio-eventloop.rst:569 msgid "" "*sock* can optionally be specified in order to use a preexisting, already " "connected, :class:`socket.socket` object to be used by the transport. If " @@ -775,33 +785,33 @@ msgid "" "`None`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:574 +#: ../../library/asyncio-eventloop.rst:580 msgid "" "See :ref:`UDP echo client protocol ` and :" "ref:`UDP echo server protocol ` examples." msgstr "" -#: ../../library/asyncio-eventloop.rst:577 +#: ../../library/asyncio-eventloop.rst:583 msgid "" "The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " "*allow_broadcast*, and *sock* parameters were added." msgstr "" -#: ../../library/asyncio-eventloop.rst:581 +#: ../../library/asyncio-eventloop.rst:587 msgid "" "The *reuse_address* parameter is no longer supported, as using :py:data:" "`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " "Explicitly passing ``reuse_address=True`` will raise an exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:586 +#: ../../library/asyncio-eventloop.rst:592 msgid "" "When multiple processes with differing UIDs assign sockets to an identical " "UDP socket address with ``SO_REUSEADDR``, incoming packets can become " "randomly distributed among the sockets." msgstr "" -#: ../../library/asyncio-eventloop.rst:590 +#: ../../library/asyncio-eventloop.rst:596 msgid "" "For supported platforms, *reuse_port* can be used as a replacement for " "similar functionality. With *reuse_port*, :py:data:`~sockets.SO_REUSEPORT` " @@ -809,95 +819,95 @@ msgid "" "from assigning sockets to the same socket address." msgstr "" -#: ../../library/asyncio-eventloop.rst:596 +#: ../../library/asyncio-eventloop.rst:602 msgid "Added support for Windows." msgstr "新增對於 Windows 的支援。" -#: ../../library/asyncio-eventloop.rst:599 +#: ../../library/asyncio-eventloop.rst:605 msgid "" "The *reuse_address* parameter, disabled since Python 3.9.0, 3.8.1, 3.7.6 and " "3.6.10, has been entirely removed." msgstr "" -#: ../../library/asyncio-eventloop.rst:608 +#: ../../library/asyncio-eventloop.rst:614 msgid "Create a Unix connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:610 +#: ../../library/asyncio-eventloop.rst:616 msgid "" "The socket family will be :py:data:`~socket.AF_UNIX`; socket type will be :" "py:data:`~socket.SOCK_STREAM`." msgstr "" -#: ../../library/asyncio-eventloop.rst:615 +#: ../../library/asyncio-eventloop.rst:621 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" "`bytes`, and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:620 +#: ../../library/asyncio-eventloop.rst:626 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:624 -#: ../../library/asyncio-eventloop.rst:764 -#: ../../library/asyncio-eventloop.rst:1187 +#: ../../library/asyncio-eventloop.rst:630 +#: ../../library/asyncio-eventloop.rst:770 +#: ../../library/asyncio-eventloop.rst:1193 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" -#: ../../library/asyncio-eventloop.rst:625 +#: ../../library/asyncio-eventloop.rst:631 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:635 +#: ../../library/asyncio-eventloop.rst:641 msgid "Creating network servers" msgstr "" -#: ../../library/asyncio-eventloop.rst:647 +#: ../../library/asyncio-eventloop.rst:653 msgid "" "Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" -#: ../../library/asyncio-eventloop.rst:650 +#: ../../library/asyncio-eventloop.rst:656 msgid "Returns a :class:`Server` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:652 +#: ../../library/asyncio-eventloop.rst:658 msgid "Arguments:" msgstr "引數:" -#: ../../library/asyncio-eventloop.rst:657 +#: ../../library/asyncio-eventloop.rst:663 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" msgstr "" -#: ../../library/asyncio-eventloop.rst:660 +#: ../../library/asyncio-eventloop.rst:666 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." msgstr "" -#: ../../library/asyncio-eventloop.rst:663 +#: ../../library/asyncio-eventloop.rst:669 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." msgstr "" -#: ../../library/asyncio-eventloop.rst:666 +#: ../../library/asyncio-eventloop.rst:672 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " "another one for IPv6)." msgstr "" -#: ../../library/asyncio-eventloop.rst:670 +#: ../../library/asyncio-eventloop.rst:676 msgid "" "The *port* parameter can be set to specify which port the server should " "listen on. If ``0`` or ``None`` (the default), a random unused port will be " @@ -905,63 +915,63 @@ msgid "" "different random port will be selected for each interface)." msgstr "" -#: ../../library/asyncio-eventloop.rst:675 +#: ../../library/asyncio-eventloop.rst:681 msgid "" "*family* can be set to either :data:`socket.AF_INET` or :data:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " "will be determined from host name (defaults to :data:`~socket.AF_UNSPEC`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:680 +#: ../../library/asyncio-eventloop.rst:686 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:682 +#: ../../library/asyncio-eventloop.rst:688 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." msgstr "" -#: ../../library/asyncio-eventloop.rst:687 +#: ../../library/asyncio-eventloop.rst:693 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:691 +#: ../../library/asyncio-eventloop.rst:697 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." msgstr "" -#: ../../library/asyncio-eventloop.rst:694 +#: ../../library/asyncio-eventloop.rst:700 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:697 +#: ../../library/asyncio-eventloop.rst:703 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " "will automatically be set to ``True`` on Unix." msgstr "" -#: ../../library/asyncio-eventloop.rst:702 +#: ../../library/asyncio-eventloop.rst:708 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:707 +#: ../../library/asyncio-eventloop.rst:713 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " "seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:715 +#: ../../library/asyncio-eventloop.rst:721 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -969,44 +979,44 @@ msgid "" "to make the server to start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:727 +#: ../../library/asyncio-eventloop.rst:733 msgid "The *host* parameter can be a sequence of strings." msgstr "" -#: ../../library/asyncio-eventloop.rst:731 +#: ../../library/asyncio-eventloop.rst:737 msgid "" "Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " "option :py:data:`~socket.TCP_NODELAY` is set by default for all TCP " "connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:741 +#: ../../library/asyncio-eventloop.rst:747 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " "be used in an async/await code." msgstr "" -#: ../../library/asyncio-eventloop.rst:752 +#: ../../library/asyncio-eventloop.rst:758 msgid "" "Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." "AF_UNIX` socket family." msgstr "" -#: ../../library/asyncio-eventloop.rst:755 +#: ../../library/asyncio-eventloop.rst:761 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " "and :class:`~pathlib.Path` paths are supported." msgstr "" -#: ../../library/asyncio-eventloop.rst:760 +#: ../../library/asyncio-eventloop.rst:766 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." msgstr "" -#: ../../library/asyncio-eventloop.rst:767 +#: ../../library/asyncio-eventloop.rst:773 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :class:`~pathlib.Path` object." @@ -1014,63 +1024,63 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。\\ *path* 參數現在可為" "一個 :class:`~pathlib.Path` 物件。" -#: ../../library/asyncio-eventloop.rst:779 +#: ../../library/asyncio-eventloop.rst:785 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:781 +#: ../../library/asyncio-eventloop.rst:787 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." msgstr "" -#: ../../library/asyncio-eventloop.rst:784 -#: ../../library/asyncio-eventloop.rst:871 +#: ../../library/asyncio-eventloop.rst:790 +#: ../../library/asyncio-eventloop.rst:877 msgid "Parameters:" msgstr "參數:" -#: ../../library/asyncio-eventloop.rst:789 +#: ../../library/asyncio-eventloop.rst:795 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:798 +#: ../../library/asyncio-eventloop.rst:804 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:801 +#: ../../library/asyncio-eventloop.rst:807 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " "``60.0`` seconds if ``None`` (default)." msgstr "" -#: ../../library/asyncio-eventloop.rst:809 +#: ../../library/asyncio-eventloop.rst:815 msgid "Returns a ``(transport, protocol)`` pair." msgstr "" -#: ../../library/asyncio-eventloop.rst:823 +#: ../../library/asyncio-eventloop.rst:829 msgid "Transferring files" msgstr "" -#: ../../library/asyncio-eventloop.rst:828 +#: ../../library/asyncio-eventloop.rst:834 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:831 +#: ../../library/asyncio-eventloop.rst:837 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" -#: ../../library/asyncio-eventloop.rst:833 +#: ../../library/asyncio-eventloop.rst:839 msgid "*file* must be a regular file object opened in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:835 -#: ../../library/asyncio-eventloop.rst:1075 +#: ../../library/asyncio-eventloop.rst:841 +#: ../../library/asyncio-eventloop.rst:1081 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1079,35 +1089,35 @@ msgid "" "obtain the actual number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:842 +#: ../../library/asyncio-eventloop.rst:848 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " "SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:846 +#: ../../library/asyncio-eventloop.rst:852 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:853 +#: ../../library/asyncio-eventloop.rst:859 msgid "TLS Upgrade" msgstr "" -#: ../../library/asyncio-eventloop.rst:860 +#: ../../library/asyncio-eventloop.rst:866 msgid "Upgrade an existing transport-based connection to TLS." msgstr "" -#: ../../library/asyncio-eventloop.rst:862 +#: ../../library/asyncio-eventloop.rst:868 msgid "" "Create a TLS coder/decoder instance and insert it between the *transport* " "and the *protocol*. The coder/decoder implements both *transport*-facing " "protocol and *protocol*-facing transport." msgstr "" -#: ../../library/asyncio-eventloop.rst:866 +#: ../../library/asyncio-eventloop.rst:872 msgid "" "Return the created two-interface instance. After *await*, the *protocol* " "must stop using the original *transport* and communicate with the returned " @@ -1115,70 +1125,70 @@ msgid "" "exchanges extra TLS session packets with *transport*." msgstr "" -#: ../../library/asyncio-eventloop.rst:873 +#: ../../library/asyncio-eventloop.rst:879 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." msgstr "" -#: ../../library/asyncio-eventloop.rst:877 +#: ../../library/asyncio-eventloop.rst:883 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-eventloop.rst:879 +#: ../../library/asyncio-eventloop.rst:885 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." msgstr "" -#: ../../library/asyncio-eventloop.rst:882 +#: ../../library/asyncio-eventloop.rst:888 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-eventloop.rst:902 +#: ../../library/asyncio-eventloop.rst:908 msgid "Watching file descriptors" msgstr "" -#: ../../library/asyncio-eventloop.rst:906 +#: ../../library/asyncio-eventloop.rst:912 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." msgstr "" -#: ../../library/asyncio-eventloop.rst:912 +#: ../../library/asyncio-eventloop.rst:918 msgid "Stop monitoring the *fd* file descriptor for read availability." msgstr "" -#: ../../library/asyncio-eventloop.rst:916 +#: ../../library/asyncio-eventloop.rst:922 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:920 -#: ../../library/asyncio-eventloop.rst:1174 +#: ../../library/asyncio-eventloop.rst:926 +#: ../../library/asyncio-eventloop.rst:1180 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:925 +#: ../../library/asyncio-eventloop.rst:931 msgid "Stop monitoring the *fd* file descriptor for write availability." msgstr "" -#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:933 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:932 +#: ../../library/asyncio-eventloop.rst:938 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:934 +#: ../../library/asyncio-eventloop.rst:940 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1187,72 +1197,72 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:943 +#: ../../library/asyncio-eventloop.rst:949 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:946 +#: ../../library/asyncio-eventloop.rst:952 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:948 -#: ../../library/asyncio-eventloop.rst:962 -#: ../../library/asyncio-eventloop.rst:973 -#: ../../library/asyncio-eventloop.rst:985 -#: ../../library/asyncio-eventloop.rst:1000 -#: ../../library/asyncio-eventloop.rst:1015 -#: ../../library/asyncio-eventloop.rst:1025 -#: ../../library/asyncio-eventloop.rst:1051 -#: ../../library/asyncio-eventloop.rst:1089 +#: ../../library/asyncio-eventloop.rst:954 +#: ../../library/asyncio-eventloop.rst:968 +#: ../../library/asyncio-eventloop.rst:979 +#: ../../library/asyncio-eventloop.rst:991 +#: ../../library/asyncio-eventloop.rst:1006 +#: ../../library/asyncio-eventloop.rst:1021 +#: ../../library/asyncio-eventloop.rst:1031 +#: ../../library/asyncio-eventloop.rst:1057 +#: ../../library/asyncio-eventloop.rst:1095 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:950 +#: ../../library/asyncio-eventloop.rst:956 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:957 +#: ../../library/asyncio-eventloop.rst:963 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:960 +#: ../../library/asyncio-eventloop.rst:966 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:968 +#: ../../library/asyncio-eventloop.rst:974 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:971 +#: ../../library/asyncio-eventloop.rst:977 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:979 +#: ../../library/asyncio-eventloop.rst:985 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:983 +#: ../../library/asyncio-eventloop.rst:989 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:991 +#: ../../library/asyncio-eventloop.rst:997 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:994 +#: ../../library/asyncio-eventloop.rst:1000 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1261,34 +1271,34 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1002 -#: ../../library/asyncio-eventloop.rst:1053 +#: ../../library/asyncio-eventloop.rst:1008 +#: ../../library/asyncio-eventloop.rst:1059 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1009 +#: ../../library/asyncio-eventloop.rst:1015 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1013 +#: ../../library/asyncio-eventloop.rst:1019 msgid "Return the number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1021 +#: ../../library/asyncio-eventloop.rst:1027 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1023 +#: ../../library/asyncio-eventloop.rst:1029 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1027 +#: ../../library/asyncio-eventloop.rst:1033 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1296,19 +1306,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1036 +#: ../../library/asyncio-eventloop.rst:1042 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1042 +#: ../../library/asyncio-eventloop.rst:1048 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1045 +#: ../../library/asyncio-eventloop.rst:1051 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1316,57 +1326,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1060 +#: ../../library/asyncio-eventloop.rst:1066 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:1065 +#: ../../library/asyncio-eventloop.rst:1071 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1068 +#: ../../library/asyncio-eventloop.rst:1074 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1070 +#: ../../library/asyncio-eventloop.rst:1076 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1073 +#: ../../library/asyncio-eventloop.rst:1079 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1082 +#: ../../library/asyncio-eventloop.rst:1088 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1086 +#: ../../library/asyncio-eventloop.rst:1092 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1095 +#: ../../library/asyncio-eventloop.rst:1101 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1100 +#: ../../library/asyncio-eventloop.rst:1106 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1104 +#: ../../library/asyncio-eventloop.rst:1110 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1106 +#: ../../library/asyncio-eventloop.rst:1112 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1374,67 +1384,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:1114 +#: ../../library/asyncio-eventloop.rst:1120 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:1118 +#: ../../library/asyncio-eventloop.rst:1124 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1123 +#: ../../library/asyncio-eventloop.rst:1129 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1125 +#: ../../library/asyncio-eventloop.rst:1131 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1129 -#: ../../library/asyncio-eventloop.rst:1145 +#: ../../library/asyncio-eventloop.rst:1135 +#: ../../library/asyncio-eventloop.rst:1151 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1134 +#: ../../library/asyncio-eventloop.rst:1140 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1139 +#: ../../library/asyncio-eventloop.rst:1145 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1141 +#: ../../library/asyncio-eventloop.rst:1147 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1150 +#: ../../library/asyncio-eventloop.rst:1156 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1155 +#: ../../library/asyncio-eventloop.rst:1161 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1160 +#: ../../library/asyncio-eventloop.rst:1166 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1164 +#: ../../library/asyncio-eventloop.rst:1170 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1166 +#: ../../library/asyncio-eventloop.rst:1172 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1442,46 +1452,46 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1171 +#: ../../library/asyncio-eventloop.rst:1177 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1177 +#: ../../library/asyncio-eventloop.rst:1183 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1182 +#: ../../library/asyncio-eventloop.rst:1188 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1184 +#: ../../library/asyncio-eventloop.rst:1190 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1191 +#: ../../library/asyncio-eventloop.rst:1197 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1195 +#: ../../library/asyncio-eventloop.rst:1201 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1199 +#: ../../library/asyncio-eventloop.rst:1205 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1201 +#: ../../library/asyncio-eventloop.rst:1207 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1246 +#: ../../library/asyncio-eventloop.rst:1252 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1489,17 +1499,17 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1251 +#: ../../library/asyncio-eventloop.rst:1257 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1253 +#: ../../library/asyncio-eventloop.rst:1259 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1256 +#: ../../library/asyncio-eventloop.rst:1262 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1507,32 +1517,32 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1265 +#: ../../library/asyncio-eventloop.rst:1271 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1269 +#: ../../library/asyncio-eventloop.rst:1275 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1275 +#: ../../library/asyncio-eventloop.rst:1281 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1277 +#: ../../library/asyncio-eventloop.rst:1283 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1281 +#: ../../library/asyncio-eventloop.rst:1287 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1283 +#: ../../library/asyncio-eventloop.rst:1289 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1541,158 +1551,158 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1293 +#: ../../library/asyncio-eventloop.rst:1299 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1300 +#: ../../library/asyncio-eventloop.rst:1306 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1302 +#: ../../library/asyncio-eventloop.rst:1308 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1306 +#: ../../library/asyncio-eventloop.rst:1312 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1311 +#: ../../library/asyncio-eventloop.rst:1317 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1313 +#: ../../library/asyncio-eventloop.rst:1319 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1316 +#: ../../library/asyncio-eventloop.rst:1322 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1317 +#: ../../library/asyncio-eventloop.rst:1323 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1318 +#: ../../library/asyncio-eventloop.rst:1324 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1319 +#: ../../library/asyncio-eventloop.rst:1325 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1320 +#: ../../library/asyncio-eventloop.rst:1326 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1321 +#: ../../library/asyncio-eventloop.rst:1327 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1322 +#: ../../library/asyncio-eventloop.rst:1328 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1323 +#: ../../library/asyncio-eventloop.rst:1329 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1325 +#: ../../library/asyncio-eventloop.rst:1331 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1325 +#: ../../library/asyncio-eventloop.rst:1331 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1329 +#: ../../library/asyncio-eventloop.rst:1335 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1334 +#: ../../library/asyncio-eventloop.rst:1340 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1338 +#: ../../library/asyncio-eventloop.rst:1344 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1340 +#: ../../library/asyncio-eventloop.rst:1346 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1346 +#: ../../library/asyncio-eventloop.rst:1352 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1350 +#: ../../library/asyncio-eventloop.rst:1356 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1355 +#: ../../library/asyncio-eventloop.rst:1361 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1359 +#: ../../library/asyncio-eventloop.rst:1365 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1361 +#: ../../library/asyncio-eventloop.rst:1367 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1368 +#: ../../library/asyncio-eventloop.rst:1374 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1377 +#: ../../library/asyncio-eventloop.rst:1383 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1380 +#: ../../library/asyncio-eventloop.rst:1386 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1382 +#: ../../library/asyncio-eventloop.rst:1388 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1383 +#: ../../library/asyncio-eventloop.rst:1389 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1386 +#: ../../library/asyncio-eventloop.rst:1392 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1390 +#: ../../library/asyncio-eventloop.rst:1396 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1700,136 +1710,136 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1396 +#: ../../library/asyncio-eventloop.rst:1402 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1399 +#: ../../library/asyncio-eventloop.rst:1405 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1401 +#: ../../library/asyncio-eventloop.rst:1407 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1403 +#: ../../library/asyncio-eventloop.rst:1409 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard input stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1406 -#: ../../library/asyncio-eventloop.rst:1418 -#: ../../library/asyncio-eventloop.rst:1430 +#: ../../library/asyncio-eventloop.rst:1412 +#: ../../library/asyncio-eventloop.rst:1424 +#: ../../library/asyncio-eventloop.rst:1436 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1408 -#: ../../library/asyncio-eventloop.rst:1420 -#: ../../library/asyncio-eventloop.rst:1432 +#: ../../library/asyncio-eventloop.rst:1414 +#: ../../library/asyncio-eventloop.rst:1426 +#: ../../library/asyncio-eventloop.rst:1438 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1410 -#: ../../library/asyncio-eventloop.rst:1422 -#: ../../library/asyncio-eventloop.rst:1434 +#: ../../library/asyncio-eventloop.rst:1416 +#: ../../library/asyncio-eventloop.rst:1428 +#: ../../library/asyncio-eventloop.rst:1440 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1413 +#: ../../library/asyncio-eventloop.rst:1419 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1415 +#: ../../library/asyncio-eventloop.rst:1421 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard output stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1425 +#: ../../library/asyncio-eventloop.rst:1431 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1427 +#: ../../library/asyncio-eventloop.rst:1433 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard error stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1436 +#: ../../library/asyncio-eventloop.rst:1442 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1439 +#: ../../library/asyncio-eventloop.rst:1445 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1444 +#: ../../library/asyncio-eventloop.rst:1450 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1448 +#: ../../library/asyncio-eventloop.rst:1454 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1451 +#: ../../library/asyncio-eventloop.rst:1457 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1459 +#: ../../library/asyncio-eventloop.rst:1465 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:1470 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1467 +#: ../../library/asyncio-eventloop.rst:1473 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1470 +#: ../../library/asyncio-eventloop.rst:1476 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1473 +#: ../../library/asyncio-eventloop.rst:1479 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1478 +#: ../../library/asyncio-eventloop.rst:1484 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1839,105 +1849,105 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1487 +#: ../../library/asyncio-eventloop.rst:1493 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1491 +#: ../../library/asyncio-eventloop.rst:1497 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1496 +#: ../../library/asyncio-eventloop.rst:1502 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1501 +#: ../../library/asyncio-eventloop.rst:1507 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1507 +#: ../../library/asyncio-eventloop.rst:1513 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1510 +#: ../../library/asyncio-eventloop.rst:1516 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1514 +#: ../../library/asyncio-eventloop.rst:1520 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1516 +#: ../../library/asyncio-eventloop.rst:1522 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1523 +#: ../../library/asyncio-eventloop.rst:1529 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1525 +#: ../../library/asyncio-eventloop.rst:1531 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1529 +#: ../../library/asyncio-eventloop.rst:1535 msgid "Do not instantiate the class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1533 +#: ../../library/asyncio-eventloop.rst:1539 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1546 +#: ../../library/asyncio-eventloop.rst:1552 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1551 +#: ../../library/asyncio-eventloop.rst:1557 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1554 +#: ../../library/asyncio-eventloop.rst:1560 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1557 +#: ../../library/asyncio-eventloop.rst:1563 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1562 +#: ../../library/asyncio-eventloop.rst:1568 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1568 +#: ../../library/asyncio-eventloop.rst:1574 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1570 +#: ../../library/asyncio-eventloop.rst:1576 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1573 +#: ../../library/asyncio-eventloop.rst:1579 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -1946,96 +1956,96 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1584 +#: ../../library/asyncio-eventloop.rst:1590 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1588 +#: ../../library/asyncio-eventloop.rst:1594 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1610 +#: ../../library/asyncio-eventloop.rst:1616 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1616 +#: ../../library/asyncio-eventloop.rst:1622 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1620 +#: ../../library/asyncio-eventloop.rst:1626 msgid "List of :class:`socket.socket` objects the server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1622 +#: ../../library/asyncio-eventloop.rst:1628 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1632 +#: ../../library/asyncio-eventloop.rst:1638 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1634 +#: ../../library/asyncio-eventloop.rst:1640 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1637 +#: ../../library/asyncio-eventloop.rst:1643 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1643 +#: ../../library/asyncio-eventloop.rst:1649 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1645 +#: ../../library/asyncio-eventloop.rst:1651 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1660 +#: ../../library/asyncio-eventloop.rst:1666 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1665 +#: ../../library/asyncio-eventloop.rst:1671 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1668 +#: ../../library/asyncio-eventloop.rst:1674 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1671 +#: ../../library/asyncio-eventloop.rst:1677 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1677 +#: ../../library/asyncio-eventloop.rst:1683 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1679 +#: ../../library/asyncio-eventloop.rst:1685 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1685 +#: ../../library/asyncio-eventloop.rst:1691 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1687 +#: ../../library/asyncio-eventloop.rst:1693 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2043,70 +2053,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1697 +#: ../../library/asyncio-eventloop.rst:1703 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1699 +#: ../../library/asyncio-eventloop.rst:1705 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1723 +#: ../../library/asyncio-eventloop.rst:1729 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1730 +#: ../../library/asyncio-eventloop.rst:1736 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1732 +#: ../../library/asyncio-eventloop.rst:1738 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1760 +#: ../../library/asyncio-eventloop.rst:1766 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1767 +#: ../../library/asyncio-eventloop.rst:1773 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1769 +#: ../../library/asyncio-eventloop.rst:1775 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1807 +#: ../../library/asyncio-eventloop.rst:1813 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1811 +#: ../../library/asyncio-eventloop.rst:1817 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1819 +#: ../../library/asyncio-eventloop.rst:1825 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1821 +#: ../../library/asyncio-eventloop.rst:1827 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1823 +#: ../../library/asyncio-eventloop.rst:1829 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 8f385e9774d..6a9b5681155 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-12-07 00:17+0000\n" "PO-Revision-Date: 2022-02-09 11:27+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -44,7 +44,8 @@ msgid ":func:`asyncio.get_event_loop`" msgstr ":func:`asyncio.get_event_loop`" #: ../../library/asyncio-llapi-index.rst:22 -msgid "Get an event loop instance (current or via the policy)." +#, fuzzy +msgid "Get an event loop instance (running or current via the current policy)." msgstr "獲得一個(當前的或透過 policy 建立的)事件迴圈實例。" #: ../../library/asyncio-llapi-index.rst:24 @@ -404,8 +405,7 @@ msgstr "``await`` :meth:`loop.sock_recvfrom_into`" #: ../../library/asyncio-llapi-index.rst:196 msgid "Receive a datagram from the :class:`~socket.socket` into a buffer." -msgstr "" -"將從 :class:`~socket.socket` 接收到的資料單元存放於一個緩衝區中。" +msgstr "將從 :class:`~socket.socket` 接收到的資料單元存放於一個緩衝區中。" #: ../../library/asyncio-llapi-index.rst:198 msgid "``await`` :meth:`loop.sock_sendall`" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index 410ac9d0833..7da2ec5a831 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-29 00:25+0000\n" +"POT-Creation-Date: 2022-12-07 00:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -145,40 +145,47 @@ msgstr "" msgid "On Windows, :class:`ProactorEventLoop` is now used by default." msgstr "" -#: ../../library/asyncio-policy.rst:118 +#: ../../library/asyncio-policy.rst:115 +msgid "" +":meth:`get_event_loop` now emits a :exc:`DeprecationWarning` if there is no " +"current event loop set and a new event loop has been implicitly created. In " +"Python 3.12 it will be an error." +msgstr "" + +#: ../../library/asyncio-policy.rst:123 msgid "" "An alternative event loop policy that uses the :class:`SelectorEventLoop` " "event loop implementation." msgstr "" -#: ../../library/asyncio-policy.rst:121 ../../library/asyncio-policy.rst:129 +#: ../../library/asyncio-policy.rst:126 ../../library/asyncio-policy.rst:134 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-policy.rst:126 +#: ../../library/asyncio-policy.rst:131 msgid "" "An alternative event loop policy that uses the :class:`ProactorEventLoop` " "event loop implementation." msgstr "" -#: ../../library/asyncio-policy.rst:135 +#: ../../library/asyncio-policy.rst:140 msgid "Process Watchers" msgstr "" -#: ../../library/asyncio-policy.rst:137 +#: ../../library/asyncio-policy.rst:142 msgid "" "A process watcher allows customization of how an event loop monitors child " "processes on Unix. Specifically, the event loop needs to know when a child " "process has exited." msgstr "" -#: ../../library/asyncio-policy.rst:141 +#: ../../library/asyncio-policy.rst:146 msgid "" "In asyncio, child processes are created with :func:`create_subprocess_exec` " "and :meth:`loop.subprocess_exec` functions." msgstr "" -#: ../../library/asyncio-policy.rst:145 +#: ../../library/asyncio-policy.rst:150 msgid "" "asyncio defines the :class:`AbstractChildWatcher` abstract base class, which " "child watchers should implement, and has four different implementations: :" @@ -187,176 +194,176 @@ msgid "" "`FastChildWatcher`." msgstr "" -#: ../../library/asyncio-policy.rst:151 +#: ../../library/asyncio-policy.rst:156 msgid "" "See also the :ref:`Subprocess and Threads ` " "section." msgstr "" -#: ../../library/asyncio-policy.rst:154 +#: ../../library/asyncio-policy.rst:159 msgid "" "The following two functions can be used to customize the child process " "watcher implementation used by the asyncio event loop:" msgstr "" -#: ../../library/asyncio-policy.rst:159 +#: ../../library/asyncio-policy.rst:164 msgid "Return the current child watcher for the current policy." msgstr "" -#: ../../library/asyncio-policy.rst:163 +#: ../../library/asyncio-policy.rst:168 msgid "" "Set the current child watcher to *watcher* for the current policy. " "*watcher* must implement methods defined in the :class:" "`AbstractChildWatcher` base class." msgstr "" -#: ../../library/asyncio-policy.rst:168 +#: ../../library/asyncio-policy.rst:173 msgid "" "Third-party event loops implementations might not support custom child " "watchers. For such event loops, using :func:`set_child_watcher` might be " "prohibited or have no effect." msgstr "" -#: ../../library/asyncio-policy.rst:176 +#: ../../library/asyncio-policy.rst:181 msgid "Register a new child handler." msgstr "" -#: ../../library/asyncio-policy.rst:178 +#: ../../library/asyncio-policy.rst:183 msgid "" "Arrange for ``callback(pid, returncode, *args)`` to be called when a process " "with PID equal to *pid* terminates. Specifying another callback for the " "same process replaces the previous handler." msgstr "" -#: ../../library/asyncio-policy.rst:183 +#: ../../library/asyncio-policy.rst:188 msgid "The *callback* callable must be thread-safe." msgstr "" -#: ../../library/asyncio-policy.rst:187 +#: ../../library/asyncio-policy.rst:192 msgid "Removes the handler for process with PID equal to *pid*." msgstr "" -#: ../../library/asyncio-policy.rst:189 +#: ../../library/asyncio-policy.rst:194 msgid "" "The function returns ``True`` if the handler was successfully removed, " "``False`` if there was nothing to remove." msgstr "" -#: ../../library/asyncio-policy.rst:194 +#: ../../library/asyncio-policy.rst:199 msgid "Attach the watcher to an event loop." msgstr "" -#: ../../library/asyncio-policy.rst:196 +#: ../../library/asyncio-policy.rst:201 msgid "" "If the watcher was previously attached to an event loop, then it is first " "detached before attaching to the new loop." msgstr "" -#: ../../library/asyncio-policy.rst:199 +#: ../../library/asyncio-policy.rst:204 msgid "Note: loop may be ``None``." msgstr "" -#: ../../library/asyncio-policy.rst:203 +#: ../../library/asyncio-policy.rst:208 msgid "Return ``True`` if the watcher is ready to use." msgstr "" -#: ../../library/asyncio-policy.rst:205 +#: ../../library/asyncio-policy.rst:210 msgid "" "Spawning a subprocess with *inactive* current child watcher raises :exc:" "`RuntimeError`." msgstr "" -#: ../../library/asyncio-policy.rst:212 +#: ../../library/asyncio-policy.rst:217 msgid "Close the watcher." msgstr "" -#: ../../library/asyncio-policy.rst:214 +#: ../../library/asyncio-policy.rst:219 msgid "" "This method has to be called to ensure that underlying resources are cleaned-" "up." msgstr "" -#: ../../library/asyncio-policy.rst:219 +#: ../../library/asyncio-policy.rst:224 msgid "" "This implementation starts a new waiting thread for every subprocess spawn." msgstr "" -#: ../../library/asyncio-policy.rst:221 +#: ../../library/asyncio-policy.rst:226 msgid "" "It works reliably even when the asyncio event loop is run in a non-main OS " "thread." msgstr "" -#: ../../library/asyncio-policy.rst:223 +#: ../../library/asyncio-policy.rst:228 msgid "" "There is no noticeable overhead when handling a big number of children " "(*O(1)* each time a child terminates), but starting a thread per process " "requires extra memory." msgstr "" -#: ../../library/asyncio-policy.rst:226 +#: ../../library/asyncio-policy.rst:231 msgid "This watcher is used by default." msgstr "" -#: ../../library/asyncio-policy.rst:232 +#: ../../library/asyncio-policy.rst:237 msgid "" "This implementation registers a :py:data:`SIGCHLD` signal handler on " "instantiation. That can break third-party code that installs a custom " "handler for :py:data:`SIGCHLD` signal." msgstr "" -#: ../../library/asyncio-policy.rst:236 ../../library/asyncio-policy.rst:254 +#: ../../library/asyncio-policy.rst:241 ../../library/asyncio-policy.rst:259 msgid "" "The watcher avoids disrupting other code spawning processes by polling every " "process explicitly on a :py:data:`SIGCHLD` signal." msgstr "" -#: ../../library/asyncio-policy.rst:239 +#: ../../library/asyncio-policy.rst:244 msgid "" "There is no limitation for running subprocesses from different threads once " "the watcher is installed." msgstr "" -#: ../../library/asyncio-policy.rst:242 +#: ../../library/asyncio-policy.rst:247 msgid "" "The solution is safe but it has a significant overhead when handling a big " "number of processes (*O(n)* each time a :py:data:`SIGCHLD` is received)." msgstr "" -#: ../../library/asyncio-policy.rst:250 +#: ../../library/asyncio-policy.rst:255 msgid "" "This implementation uses active event loop from the main thread to handle :" "py:data:`SIGCHLD` signal. If the main thread has no running event loop " "another thread cannot spawn a subprocess (:exc:`RuntimeError` is raised)." msgstr "" -#: ../../library/asyncio-policy.rst:257 +#: ../../library/asyncio-policy.rst:262 msgid "" "This solution is as safe as :class:`MultiLoopChildWatcher` and has the same " "*O(N)* complexity but requires a running event loop in the main thread to " "work." msgstr "" -#: ../../library/asyncio-policy.rst:262 +#: ../../library/asyncio-policy.rst:267 msgid "" "This implementation reaps every terminated processes by calling ``os." "waitpid(-1)`` directly, possibly breaking other code spawning processes and " "waiting for their termination." msgstr "" -#: ../../library/asyncio-policy.rst:266 +#: ../../library/asyncio-policy.rst:271 msgid "" "There is no noticeable overhead when handling a big number of children " "(*O(1)* each time a child terminates)." msgstr "" -#: ../../library/asyncio-policy.rst:269 +#: ../../library/asyncio-policy.rst:274 msgid "" "This solution requires a running event loop in the main thread to work, as :" "class:`SafeChildWatcher`." msgstr "" -#: ../../library/asyncio-policy.rst:274 +#: ../../library/asyncio-policy.rst:279 msgid "" "This implementation polls process file descriptors (pidfds) to await child " "process termination. In some respects, :class:`PidfdChildWatcher` is a " @@ -367,11 +374,11 @@ msgid "" "only work on recent (5.3+) kernels." msgstr "" -#: ../../library/asyncio-policy.rst:288 +#: ../../library/asyncio-policy.rst:293 msgid "Custom Policies" msgstr "" -#: ../../library/asyncio-policy.rst:290 +#: ../../library/asyncio-policy.rst:295 msgid "" "To implement a new event loop policy, it is recommended to subclass :class:" "`DefaultEventLoopPolicy` and override the methods for which custom behavior " diff --git a/library/enum.po b/library/enum.po index 35b95fd7f1f..c3474f7c1f6 100644 --- a/library/enum.po +++ b/library/enum.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-06 00:15+0000\n" +"POT-Creation-Date: 2022-12-07 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:01+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -323,7 +323,7 @@ msgstr "" #: ../../library/enum.rst:204 msgid "" -"Returns the Enum member in *cls* matching *name*, or raises an :exc:" +"Returns the Enum member in *cls* matching *name*, or raises a :exc:" "`KeyError`::" msgstr "" @@ -357,7 +357,7 @@ msgstr "" #: ../../library/enum.rst:251 msgid "" -"Member values can be anything: :class:`int`, :class:`str`, etc.. If the " +"Member values can be anything: :class:`int`, :class:`str`, etc. If the " "exact value is unimportant you may use :class:`auto` instances and an " "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" @@ -444,7 +444,7 @@ msgid "start" msgstr "" #: ../../library/enum.rst:282 -msgid "The first integer value for the Enum (used by :class:`auto`)" +msgid "The first integer value for the Enum (used by :class:`auto`)." msgstr "" #: ../../library/enum.rst:0 @@ -453,7 +453,7 @@ msgstr "" #: ../../library/enum.rst:283 msgid "" -"How to handle out-of-range values from bit operations (:class:`Flag` only)" +"How to handle out-of-range values from bit operations (:class:`Flag` only)." msgstr "" #: ../../library/enum.rst:287 @@ -523,7 +523,7 @@ msgstr "" #: ../../library/enum.rst:382 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " -"returns :meth:`__str__` returns, but can be overridden::" +"returns :meth:`__str__` return value, but can be overridden::" msgstr "" #: ../../library/enum.rst:396 @@ -686,7 +686,7 @@ msgstr "" #: ../../library/enum.rst:610 msgid "" -"Inversion of a :class:`!IntFlag` now returns a positive value that is the " +"Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " "matches the existing :class:`Flag` behavior." msgstr "" @@ -707,7 +707,7 @@ msgstr "" #: ../../library/enum.rst:622 msgid "" -"Inherit from :class:`!ReprEnum` to keep the :class:`str() / :func:" +"Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" "`format` of the mixed-in data type instead of using the :class:`Enum`-" "default :meth:`str() `." msgstr "" @@ -731,7 +731,7 @@ msgstr "" #: ../../library/enum.rst:667 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " -"values are specified instead of being generated by :func:`auto`" +"values are specified instead of being generated by :func:`auto`::" msgstr "" #: ../../library/enum.rst:684 diff --git a/library/http.server.po b/library/http.server.po index 12d0b9bb8e9..d2bababb331 100644 --- a/library/http.server.po +++ b/library/http.server.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-06 00:15+0000\n" +"POT-Creation-Date: 2022-12-07 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:03+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -627,6 +627,10 @@ msgid "" "Earlier versions of Python did not scrub control characters from the log " "messages emitted to stderr from ``python -m http.server`` or the default :" "class:`BaseHTTPRequestHandler` ``.log_message`` implementation. This could " -"allow to remote clients connecting to your server to send nefarious control " +"allow remote clients connecting to your server to send nefarious control " "codes to your terminal." msgstr "" + +#: ../../library/http.server.rst:522 +msgid "Control characters are scrubbed in stderr logs." +msgstr "" From f32a9f06baec9f5a8d5f50e3019c688edce7fcfb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 9 Dec 2022 00:19:20 +0000 Subject: [PATCH 05/11] sync with cpython ecb16d5d --- library/sqlite3.po | 104 ++++++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index b0b9e6e5027..00e2b0c83df 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-26 00:17+0000\n" +"POT-Creation-Date: 2022-12-09 00:17+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1754,11 +1754,11 @@ msgstr "" msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " -"vulnerable to `SQL injection attacks`_ (see the `xkcd webcomic `_ for a humorous example of what can go wrong)::" +"vulnerable to `SQL injection attacks`_. For example, an attacker can simply " +"close the single quote and inject ``OR TRUE`` to select all rows::" msgstr "" -#: ../../library/sqlite3.rst:1823 +#: ../../library/sqlite3.rst:1827 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1774,18 +1774,18 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1865 +#: ../../library/sqlite3.rst:1869 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1867 +#: ../../library/sqlite3.rst:1871 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1871 +#: ../../library/sqlite3.rst:1875 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1795,11 +1795,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1883 +#: ../../library/sqlite3.rst:1887 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1885 +#: ../../library/sqlite3.rst:1889 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1809,84 +1809,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1916 +#: ../../library/sqlite3.rst:1920 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1918 +#: ../../library/sqlite3.rst:1922 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1948 +#: ../../library/sqlite3.rst:1952 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1950 +#: ../../library/sqlite3.rst:1954 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1955 +#: ../../library/sqlite3.rst:1959 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1958 +#: ../../library/sqlite3.rst:1962 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1963 +#: ../../library/sqlite3.rst:1967 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1972 +#: ../../library/sqlite3.rst:1976 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1976 +#: ../../library/sqlite3.rst:1980 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1977 +#: ../../library/sqlite3.rst:1981 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1978 +#: ../../library/sqlite3.rst:1982 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1982 +#: ../../library/sqlite3.rst:1986 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:2033 +#: ../../library/sqlite3.rst:2037 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:2035 +#: ../../library/sqlite3.rst:2039 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:2097 +#: ../../library/sqlite3.rst:2101 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:2099 +#: ../../library/sqlite3.rst:2103 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1898,11 +1898,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:2140 +#: ../../library/sqlite3.rst:2144 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:2142 +#: ../../library/sqlite3.rst:2146 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1912,58 +1912,58 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:2151 +#: ../../library/sqlite3.rst:2155 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:2156 +#: ../../library/sqlite3.rst:2160 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:2189 +#: ../../library/sqlite3.rst:2193 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:2191 +#: ../../library/sqlite3.rst:2195 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:2193 +#: ../../library/sqlite3.rst:2197 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:2202 +#: ../../library/sqlite3.rst:2206 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:2212 +#: ../../library/sqlite3.rst:2216 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:2226 +#: ../../library/sqlite3.rst:2230 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:2235 +#: ../../library/sqlite3.rst:2239 msgid "How to create and use row factories" msgstr "" -#: ../../library/sqlite3.rst:2237 +#: ../../library/sqlite3.rst:2241 msgid "" "By default, :mod:`!sqlite3` represents each row as a :class:`tuple`. If a :" "class:`!tuple` does not suit your needs, you can use the :class:`sqlite3." "Row` class or a custom :attr:`~Cursor.row_factory`." msgstr "" -#: ../../library/sqlite3.rst:2242 +#: ../../library/sqlite3.rst:2246 msgid "" "While :attr:`!row_factory` exists as an attribute both on the :class:" "`Cursor` and the :class:`Connection`, it is recommended to set :class:" @@ -1971,7 +1971,7 @@ msgid "" "use the same row factory." msgstr "" -#: ../../library/sqlite3.rst:2247 +#: ../../library/sqlite3.rst:2251 msgid "" ":class:`!Row` provides indexed and case-insensitive named access to columns, " "with minimal memory overhead and performance impact over a :class:`!tuple`. " @@ -1979,51 +1979,51 @@ msgid "" "attribute:" msgstr "" -#: ../../library/sqlite3.rst:2257 +#: ../../library/sqlite3.rst:2261 msgid "Queries now return :class:`!Row` objects:" msgstr "" -#: ../../library/sqlite3.rst:2272 +#: ../../library/sqlite3.rst:2276 msgid "" "You can create a custom :attr:`~Cursor.row_factory` that returns each row as " "a :class:`dict`, with column names mapped to values:" msgstr "" -#: ../../library/sqlite3.rst:2281 +#: ../../library/sqlite3.rst:2285 msgid "" "Using it, queries now return a :class:`!dict` instead of a :class:`!tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2291 +#: ../../library/sqlite3.rst:2295 msgid "The following row factory returns a :term:`named tuple`:" msgstr "" -#: ../../library/sqlite3.rst:2302 +#: ../../library/sqlite3.rst:2306 msgid ":func:`!namedtuple_factory` can be used as follows:" msgstr "" -#: ../../library/sqlite3.rst:2317 +#: ../../library/sqlite3.rst:2321 msgid "" "With some adjustments, the above recipe can be adapted to use a :class:" "`~dataclasses.dataclass`, or any other custom class, instead of a :class:" "`~collections.namedtuple`." msgstr "" -#: ../../library/sqlite3.rst:2325 +#: ../../library/sqlite3.rst:2329 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:2330 +#: ../../library/sqlite3.rst:2334 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:2332 +#: ../../library/sqlite3.rst:2336 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:2335 +#: ../../library/sqlite3.rst:2339 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -2037,7 +2037,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:2348 +#: ../../library/sqlite3.rst:2352 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -2047,14 +2047,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:2356 +#: ../../library/sqlite3.rst:2360 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:2360 +#: ../../library/sqlite3.rst:2364 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." From c568b4adb69d1da5dd4e65f47cdcaee01f22e513 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 11 Dec 2022 00:20:00 +0000 Subject: [PATCH 06/11] sync with cpython 606adb4b --- library/datetime.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/datetime.po b/library/datetime.po index 069b1426e13..66bcbd488f1 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-12-11 00:18+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -158,9 +158,9 @@ msgstr "" #: ../../library/datetime.rst:107 msgid "" "An idealized time, independent of any particular day, assuming that every " -"day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap seconds" -"\" here.) Attributes: :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" -"`microsecond`, and :attr:`.tzinfo`." +"day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap " +"seconds\" here.) Attributes: :attr:`hour`, :attr:`minute`, :attr:`second`, :" +"attr:`microsecond`, and :attr:`.tzinfo`." msgstr "" #: ../../library/datetime.rst:116 @@ -3133,7 +3133,7 @@ msgstr "" #: ../../library/datetime.rst:2591 msgid "" "When used with the :meth:`strptime` method, the leading zero is optional " -"for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%J``, ``%U``, " +"for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, " "``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" From f662eb5cb179a37a8b111853deb6f1cfd434db73 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 13 Dec 2022 00:18:50 +0000 Subject: [PATCH 07/11] sync with cpython 60383a3c --- tutorial/classes.po | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tutorial/classes.po b/tutorial/classes.po index f7725a30000..7d028f71ef4 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-07-06 00:17+0000\n" +"POT-Creation-Date: 2022-12-13 00:16+0000\n" "PO-Revision-Date: 2021-06-06 02:14+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -211,8 +211,8 @@ msgstr "" "命名空間會被建立;一般情況下,模組的命名空間也會持續到直譯器結束。被直譯器的" "頂層調用 (top-level invocation) 執行的陳述式,不論是從腳本檔案讀取的或是互動" "模式中的,會被視為一個稱為 :mod:`__main__` 的模組的一部分,因此它們具有自己的" -"全域命名空間。(內建名稱實際上也存在一個模組中,它被稱為 :mod:`builtins`" -"\\ 。)" +"全域命名空間。(內建名稱實際上也存在一個模組中,它被稱為 :mod:" +"`builtins`\\ 。)" #: ../../tutorial/classes.rst:106 msgid "" @@ -250,9 +250,10 @@ msgid "the innermost scope, which is searched first, contains the local names" msgstr "最內層作用域,會最先被搜尋,而它包含了區域名稱" #: ../../tutorial/classes.rst:121 +#, fuzzy msgid "" "the scopes of any enclosing functions, which are searched starting with the " -"nearest enclosing scope, contains non-local, but also non-global names" +"nearest enclosing scope, contain non-local, but also non-global names" msgstr "" "任何外圍函式 (enclosing function) 的作用域,會從最近的外圍作用域開始搜尋,它" "包含了非區域 (non-local) 和非全域 (non-global) 的名稱" @@ -268,9 +269,10 @@ msgid "" msgstr "最外面的作用域(最後搜尋),是包含內建名稱的命名空間" #: ../../tutorial/classes.rst:126 +#, fuzzy msgid "" "If a name is declared global, then all references and assignments go " -"directly to the middle scope containing the module's global names. To " +"directly to the next-to-last scope containing the module's global names. To " "rebind variables found outside of the innermost scope, the :keyword:" "`nonlocal` statement can be used; if not declared nonlocal, those variables " "are read-only (an attempt to write to such a variable will simply create a " @@ -359,10 +361,10 @@ msgstr "範例程式碼的輸出是:" #: ../../tutorial/classes.rst:200 msgid "" -"Note how the *local* assignment (which is default) didn't change *scope_test*" -"\\'s binding of *spam*. The :keyword:`nonlocal` assignment changed " -"*scope_test*\\'s binding of *spam*, and the :keyword:`global` assignment " -"changed the module-level binding." +"Note how the *local* assignment (which is default) didn't change " +"*scope_test*\\'s binding of *spam*. The :keyword:`nonlocal` assignment " +"changed *scope_test*\\'s binding of *spam*, and the :keyword:`global` " +"assignment changed the module-level binding." msgstr "" "請注意,\\ *區域*\\ 賦值(預設情況)不會改變 *scope_test* 對 *spam* 的連" "結。\\ :keyword:`nonlocal` 賦值改變了 *scope_test* 對 *spam* 的連結,而 :" @@ -833,8 +835,8 @@ msgid "" "Each value is an object, and therefore has a *class* (also called its " "*type*). It is stored as ``object.__class__``." msgstr "" -"每個值都是一個物件,因此都具有一個 *class*\\ ,也可以稱為它的 *type(型別)*" -"\\ 。它以 ``object.__class__`` 被儲存。" +"每個值都是一個物件,因此都具有一個 *class*\\ ,也可以稱為它的 *type(型別)" +"*\\ 。它以 ``object.__class__`` 被儲存。" #: ../../tutorial/classes.rst:571 msgid "Inheritance" @@ -1009,10 +1011,10 @@ msgstr "" "自 :class:`object`\\ ,因此任何多重繼承的情況都提供了多個到達 :class:" "`object` 的路徑。為了避免 base class 被多次存取,動態演算法以這些方式將搜尋順" "序線性化 (linearize):保留每個 class 中規定的從左到右的順序、對每個 parent 只" -"會呼叫一次、使用單調的 (monotonic) 方式(意思是,一個 class 可以被 " -"subclassed(子類別化),而不會影響其 parent 的搜尋優先順序)。總之,這些特性" -"使設計出可靠又可擴充、具有多重繼承的 class 成為可能。更多資訊,請見 https://" -"www.python.org/download/releases/2.3/mro/。" +"會呼叫一次、使用單調的 (monotonic) 方式(意思是,一個 class 可以被 subclassed" +"(子類別化),而不會影響其 parent 的搜尋優先順序)。總之,這些特性使設計出可" +"靠又可擴充、具有多重繼承的 class 成為可能。更多資訊,請見 https://www.python." +"org/download/releases/2.3/mro/。" #: ../../tutorial/classes.rst:674 msgid "Private Variables" From 41297a8654bb9ca43ccf94696e9c30e389889314 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 15 Dec 2022 00:18:37 +0000 Subject: [PATCH 08/11] sync with cpython cb1001ce --- library/asyncio-stream.po | 168 ++++++++++++++++++++------------------ 1 file changed, 87 insertions(+), 81 deletions(-) diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index a46ffd8bb35..91102c46dc5 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" +"POT-Creation-Date: 2022-12-15 00:16+0000\n" "PO-Revision-Date: 2022-10-31 16:28+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -59,13 +59,13 @@ msgid "" "with streams:" msgstr "下面的高階 asyncio 函式可以用來建立和處理串流:" -#: ../../library/asyncio-stream.rst:57 +#: ../../library/asyncio-stream.rst:58 msgid "" "Establish a network connection and return a pair of ``(reader, writer)`` " "objects." msgstr "建立網路連線並回傳一對 ``(reader, writer)`` 物件。" -#: ../../library/asyncio-stream.rst:60 +#: ../../library/asyncio-stream.rst:61 msgid "" "The returned *reader* and *writer* objects are instances of :class:" "`StreamReader` and :class:`StreamWriter` classes." @@ -73,7 +73,7 @@ msgstr "" "回傳的 *reader* 和 *writer* 物件是 :class:`StreamReader` 和 :class:" "`StreamWriter` 類別的實例。" -#: ../../library/asyncio-stream.rst:63 ../../library/asyncio-stream.rst:105 +#: ../../library/asyncio-stream.rst:64 ../../library/asyncio-stream.rst:109 msgid "" "*limit* determines the buffer size limit used by the returned :class:" "`StreamReader` instance. By default the *limit* is set to 64 KiB." @@ -81,37 +81,43 @@ msgstr "" "*limit* 指定了回傳的 :class:`StreamReader` 實例所使用的緩衝區 (buffer) 大小限" "制。*limit* 預設為 64 KiB。" -#: ../../library/asyncio-stream.rst:67 +#: ../../library/asyncio-stream.rst:68 msgid "" "The rest of the arguments are passed directly to :meth:`loop." "create_connection`." msgstr "其餘的引數會直接傳遞到 :meth:`loop.create_connection`。" -#: ../../library/asyncio-stream.rst:72 ../../library/asyncio-stream.rst:140 +#: ../../library/asyncio-stream.rst:73 ../../library/asyncio-stream.rst:147 msgid "" "The *sock* argument transfers ownership of the socket to the :class:" "`StreamWriter` created. To close the socket, call its :meth:`~asyncio." "StreamWriter.close` method." msgstr "" -#: ../../library/asyncio-stream.rst:76 +#: ../../library/asyncio-stream.rst:77 msgid "Added the *ssl_handshake_timeout* parameter." msgstr "新增 *ssl_handshake_timeout* 參數。" -#: ../../library/asyncio-stream.rst:79 +#: ../../library/asyncio-stream.rst:80 msgid "Added *happy_eyeballs_delay* and *interleave* parameters." msgstr "" -#: ../../library/asyncio-stream.rst:82 ../../library/asyncio-stream.rst:121 -#: ../../library/asyncio-stream.rst:150 ../../library/asyncio-stream.rst:176 +#: ../../library/asyncio-stream.rst:83 ../../library/asyncio-stream.rst:125 +#: ../../library/asyncio-stream.rst:157 ../../library/asyncio-stream.rst:187 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" -#: ../../library/asyncio-stream.rst:94 +#: ../../library/asyncio-stream.rst:86 ../../library/asyncio-stream.rst:128 +#: ../../library/asyncio-stream.rst:160 ../../library/asyncio-stream.rst:190 +#, fuzzy +msgid "Added the *ssl_shutdown_timeout* parameter." +msgstr "新增 *ssl_handshake_timeout* 參數。" + +#: ../../library/asyncio-stream.rst:98 msgid "Start a socket server." msgstr "啟動 socket 伺服器。" -#: ../../library/asyncio-stream.rst:96 +#: ../../library/asyncio-stream.rst:100 msgid "" "The *client_connected_cb* callback is called whenever a new client " "connection is established. It receives a ``(reader, writer)`` pair as two " @@ -122,7 +128,7 @@ msgstr "" "式會接收到一對引數 ``(reader, writer)``,分別為 :class:`StreamReader` 和 :" "class:`StreamWriter` 的實例。" -#: ../../library/asyncio-stream.rst:101 +#: ../../library/asyncio-stream.rst:105 msgid "" "*client_connected_cb* can be a plain callable or a :ref:`coroutine function " "`; if it is a coroutine function, it will be automatically " @@ -132,43 +138,39 @@ msgstr "" "ref:`協程函式 `;如果它是一個協程函式,它將自動作為 :class:`Task` " "來被排程。" -#: ../../library/asyncio-stream.rst:109 +#: ../../library/asyncio-stream.rst:113 msgid "" "The rest of the arguments are passed directly to :meth:`loop.create_server`." msgstr "剩下的引數將會直接傳遞給 :meth:`loop.create_server`。" -#: ../../library/asyncio-stream.rst:114 ../../library/asyncio-stream.rst:166 +#: ../../library/asyncio-stream.rst:118 ../../library/asyncio-stream.rst:177 msgid "" "The *sock* argument transfers ownership of the socket to the server created. " "To close the socket, call the server's :meth:`~asyncio.Server.close` method." msgstr "" -#: ../../library/asyncio-stream.rst:118 +#: ../../library/asyncio-stream.rst:122 msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters." msgstr "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。" -#: ../../library/asyncio-stream.rst:126 +#: ../../library/asyncio-stream.rst:133 msgid "Unix Sockets" msgstr "Unix Sockets" -#: ../../library/asyncio-stream.rst:131 +#: ../../library/asyncio-stream.rst:138 msgid "" "Establish a Unix socket connection and return a pair of ``(reader, writer)``." msgstr "建立一個 Unix socket 連線並回傳一對 ``(reader, writer)``。" -#: ../../library/asyncio-stream.rst:134 +#: ../../library/asyncio-stream.rst:141 msgid "Similar to :func:`open_connection` but operates on Unix sockets." msgstr "與 :func:`open_connection` 相似,但是是操作 Unix sockets。" -#: ../../library/asyncio-stream.rst:136 +#: ../../library/asyncio-stream.rst:143 msgid "See also the documentation of :meth:`loop.create_unix_connection`." msgstr "另請參閱 :meth:`loop.create_unix_connection` 文件。" -#: ../../library/asyncio-stream.rst:145 ../../library/asyncio-stream.rst:171 -msgid ":ref:`Availability `: Unix." -msgstr ":ref:`適用 `:Unix。" - -#: ../../library/asyncio-stream.rst:146 +#: ../../library/asyncio-stream.rst:153 msgid "" "Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " "a :term:`path-like object`" @@ -176,19 +178,23 @@ msgstr "" "新增 *ssl_handshake_timeout* 參數。*path* 參數現在可以是個 :term:`path-like " "object`" -#: ../../library/asyncio-stream.rst:158 +#: ../../library/asyncio-stream.rst:169 msgid "Start a Unix socket server." msgstr "啟動一個 Unix socket 伺服器。" -#: ../../library/asyncio-stream.rst:160 +#: ../../library/asyncio-stream.rst:171 msgid "Similar to :func:`start_server` but works with Unix sockets." msgstr "與 :func:`start_server` 相似,但會是操作 Unix sockets。" -#: ../../library/asyncio-stream.rst:162 +#: ../../library/asyncio-stream.rst:173 msgid "See also the documentation of :meth:`loop.create_unix_server`." msgstr "另請參閱 :meth:`loop.create_unix_server` 文件。" -#: ../../library/asyncio-stream.rst:172 +#: ../../library/asyncio-stream.rst:182 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`適用 `:Unix。" + +#: ../../library/asyncio-stream.rst:183 msgid "" "Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " "parameter can now be a :term:`path-like object`." @@ -196,11 +202,11 @@ msgstr "" "新增 *ssl_handshake_timeout* 與 *start_serving* 參數。*path* 參數現在可以是" "個 :term:`path-like object`。" -#: ../../library/asyncio-stream.rst:181 +#: ../../library/asyncio-stream.rst:195 msgid "StreamReader" msgstr "StreamReader" -#: ../../library/asyncio-stream.rst:185 +#: ../../library/asyncio-stream.rst:199 msgid "" "Represents a reader object that provides APIs to read data from the IO " "stream. As an :term:`asynchronous iterable`, the object supports the :" @@ -209,7 +215,7 @@ msgstr "" "表示一個有提供 API 來從 IO 串流中讀取資料的 reader 物件。作為一個 :term:" "`asynchronous iterable`,此物件支援 :keyword:`async for` 陳述式。" -#: ../../library/asyncio-stream.rst:189 +#: ../../library/asyncio-stream.rst:203 msgid "" "It is not recommended to instantiate *StreamReader* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -217,7 +223,7 @@ msgstr "" "不建議直接實例化 *StreamReader* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:195 +#: ../../library/asyncio-stream.rst:209 msgid "" "Read up to *n* bytes. If *n* is not provided, or set to ``-1``, read until " "EOF and return all read bytes." @@ -225,34 +231,34 @@ msgstr "" "讀取至多 *n* 個位元組。如果沒有設定 *n* 或被設為 ``-1``,則表示要持續讀取直" "到 EOF 並回傳所有已讀取的位元組。" -#: ../../library/asyncio-stream.rst:198 +#: ../../library/asyncio-stream.rst:212 msgid "" "If EOF was received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:203 +#: ../../library/asyncio-stream.rst:217 msgid "" "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "讀取一行,其中\"行\"指的是以 ``\\n`` 結尾的位元組序列。" -#: ../../library/asyncio-stream.rst:206 +#: ../../library/asyncio-stream.rst:220 msgid "" "If EOF is received and ``\\n`` was not found, the method returns partially " "read data." msgstr "如果讀取到 EOF 而沒有找到 ``\\n``,該方法會回傳部分的已讀取資料。" -#: ../../library/asyncio-stream.rst:209 +#: ../../library/asyncio-stream.rst:223 msgid "" "If EOF is received and the internal buffer is empty, return an empty " "``bytes`` object." msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。" -#: ../../library/asyncio-stream.rst:214 +#: ../../library/asyncio-stream.rst:228 msgid "Read exactly *n* bytes." msgstr "讀取剛好 *n* 個位元組。" -#: ../../library/asyncio-stream.rst:216 +#: ../../library/asyncio-stream.rst:230 msgid "" "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " "read. Use the :attr:`IncompleteReadError.partial` attribute to get the " @@ -262,11 +268,11 @@ msgstr "" "`IncompleteReadError`。使用 :attr:`IncompleteReadError.partial` 屬性來獲取串" "流結束前已讀取的部分資料。" -#: ../../library/asyncio-stream.rst:222 +#: ../../library/asyncio-stream.rst:236 msgid "Read data from the stream until *separator* is found." msgstr "從串流中持續讀取資料直到出現 *separator*。" -#: ../../library/asyncio-stream.rst:224 +#: ../../library/asyncio-stream.rst:238 msgid "" "On success, the data and separator will be removed from the internal buffer " "(consumed). Returned data will include the separator at the end." @@ -274,7 +280,7 @@ msgstr "" "成功後,資料和 separator(分隔符號)會從內部緩衝區中刪除(或者說是被消費掉 " "(consumed))。回傳的資料在末尾會有一個 separator。" -#: ../../library/asyncio-stream.rst:228 +#: ../../library/asyncio-stream.rst:242 msgid "" "If the amount of data read exceeds the configured stream limit, a :exc:" "`LimitOverrunError` exception is raised, and the data is left in the " @@ -283,7 +289,7 @@ msgstr "" "如果讀取的資料量超過了設定的串流限制,將會引發 :exc:`LimitOverrunError` 例" "外,資料將被留在內部緩衝區中,並可以再次被讀取。" -#: ../../library/asyncio-stream.rst:232 +#: ../../library/asyncio-stream.rst:246 msgid "" "If EOF is reached before the complete separator is found, an :exc:" "`IncompleteReadError` exception is raised, and the internal buffer is " @@ -294,20 +300,20 @@ msgstr "" "`IncompleteReadError` 例外,且內部緩衝區會被重置。:attr:`IncompleteReadError." "partial` 屬性可能包含一部分的 separator。" -#: ../../library/asyncio-stream.rst:241 +#: ../../library/asyncio-stream.rst:255 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "如果緩衝區是空的且 :meth:`feed_eof` 曾被呼叫則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:246 +#: ../../library/asyncio-stream.rst:260 msgid "StreamWriter" msgstr "StreamWriter" -#: ../../library/asyncio-stream.rst:250 +#: ../../library/asyncio-stream.rst:264 msgid "" "Represents a writer object that provides APIs to write data to the IO stream." msgstr "表示一個有提供 API 來將資料寫入 IO 串流的 writer 物件。" -#: ../../library/asyncio-stream.rst:253 +#: ../../library/asyncio-stream.rst:267 msgid "" "It is not recommended to instantiate *StreamWriter* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -315,7 +321,7 @@ msgstr "" "不建議直接實例化 *StreamWriter* 物件;使用 :func:`open_connection` 和 :func:" "`start_server` 會是較好的做法。" -#: ../../library/asyncio-stream.rst:259 +#: ../../library/asyncio-stream.rst:273 msgid "" "The method attempts to write the *data* to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -324,14 +330,14 @@ msgstr "" "此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入" "緩衝中排隊等待 (queue),直到它可被發送。" -#: ../../library/asyncio-stream.rst:263 ../../library/asyncio-stream.rst:275 +#: ../../library/asyncio-stream.rst:277 ../../library/asyncio-stream.rst:289 msgid "The method should be used along with the ``drain()`` method::" msgstr "" "此方法應當與 ``drain()`` 方法一起使用:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:270 +#: ../../library/asyncio-stream.rst:284 msgid "" "The method writes a list (or any iterable) of bytes to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -340,18 +346,18 @@ msgstr "" "此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 " "socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。" -#: ../../library/asyncio-stream.rst:282 +#: ../../library/asyncio-stream.rst:296 msgid "The method closes the stream and the underlying socket." msgstr "此方法會關閉串流以及底層的 socket。" -#: ../../library/asyncio-stream.rst:284 +#: ../../library/asyncio-stream.rst:298 msgid "The method should be used along with the ``wait_closed()`` method::" msgstr "" "此方法應與 ``wait_closed()`` 方法一起使用:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:291 +#: ../../library/asyncio-stream.rst:305 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -359,29 +365,29 @@ msgstr "" "如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 " "``False``。" -#: ../../library/asyncio-stream.rst:296 +#: ../../library/asyncio-stream.rst:310 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。" -#: ../../library/asyncio-stream.rst:301 +#: ../../library/asyncio-stream.rst:315 msgid "Return the underlying asyncio transport." msgstr "回傳底層的 asyncio 傳輸。" -#: ../../library/asyncio-stream.rst:305 +#: ../../library/asyncio-stream.rst:319 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。" -#: ../../library/asyncio-stream.rst:310 +#: ../../library/asyncio-stream.rst:324 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "" "等待直到可以繼續寫入到串流。範例:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:316 +#: ../../library/asyncio-stream.rst:330 msgid "" "This is a flow control method that interacts with the underlying IO write " "buffer. When the size of the buffer reaches the high watermark, *drain()* " @@ -393,62 +399,62 @@ msgstr "" "(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low " "watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。" -#: ../../library/asyncio-stream.rst:326 +#: ../../library/asyncio-stream.rst:340 msgid "Upgrade an existing stream-based connection to TLS." msgstr "" -#: ../../library/asyncio-stream.rst:328 +#: ../../library/asyncio-stream.rst:342 msgid "Parameters:" msgstr "" -#: ../../library/asyncio-stream.rst:330 +#: ../../library/asyncio-stream.rst:344 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "" -#: ../../library/asyncio-stream.rst:332 +#: ../../library/asyncio-stream.rst:346 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." msgstr "" -#: ../../library/asyncio-stream.rst:335 +#: ../../library/asyncio-stream.rst:349 msgid "" "*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " "to complete before aborting the connection. ``60.0`` seconds if ``None`` " "(default)." msgstr "" -#: ../../library/asyncio-stream.rst:343 +#: ../../library/asyncio-stream.rst:357 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。" -#: ../../library/asyncio-stream.rst:350 +#: ../../library/asyncio-stream.rst:364 msgid "Wait until the stream is closed." msgstr "等待直到串流被關閉。" -#: ../../library/asyncio-stream.rst:352 +#: ../../library/asyncio-stream.rst:366 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " "is closed." msgstr "應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉。" -#: ../../library/asyncio-stream.rst:359 +#: ../../library/asyncio-stream.rst:373 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-stream.rst:364 +#: ../../library/asyncio-stream.rst:378 msgid "TCP echo client using streams" msgstr "使用串流的 TCP echo 客戶端" -#: ../../library/asyncio-stream.rst:366 +#: ../../library/asyncio-stream.rst:380 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "" "使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:389 +#: ../../library/asyncio-stream.rst:403 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -457,18 +463,18 @@ msgstr "" "使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 " "`\\ 範例。" -#: ../../library/asyncio-stream.rst:396 +#: ../../library/asyncio-stream.rst:410 msgid "TCP echo server using streams" msgstr "使用串流的 TCP echo 伺服器" -#: ../../library/asyncio-stream.rst:398 +#: ../../library/asyncio-stream.rst:412 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr "" "TCP echo 伺服器使用 :func:`asyncio.start_server` 函式:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:431 +#: ../../library/asyncio-stream.rst:445 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -477,11 +483,11 @@ msgstr "" "使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 " "` 範例。" -#: ../../library/asyncio-stream.rst:436 +#: ../../library/asyncio-stream.rst:450 msgid "Get HTTP headers" msgstr "獲取 HTTP 標頭" -#: ../../library/asyncio-stream.rst:438 +#: ../../library/asyncio-stream.rst:452 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "" @@ -489,25 +495,25 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:476 +#: ../../library/asyncio-stream.rst:490 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:480 +#: ../../library/asyncio-stream.rst:494 msgid "or with HTTPS::" msgstr "" "或使用 HTTPS:\n" "\n" "::" -#: ../../library/asyncio-stream.rst:488 +#: ../../library/asyncio-stream.rst:502 msgid "Register an open socket to wait for data using streams" msgstr "註冊一個使用串流來等待資料的開放 socket" -#: ../../library/asyncio-stream.rst:490 +#: ../../library/asyncio-stream.rst:504 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" @@ -516,7 +522,7 @@ msgstr "" "\n" "::" -#: ../../library/asyncio-stream.rst:524 +#: ../../library/asyncio-stream.rst:538 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -526,7 +532,7 @@ msgstr "" "`\\ 範例中,有使用了低階協定以及 :meth:" "`loop.create_connection` 方法。" -#: ../../library/asyncio-stream.rst:528 +#: ../../library/asyncio-stream.rst:542 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." From 4a028e5149415b97b2dd8e7d9edc6fac65d65e45 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 17 Dec 2022 00:16:50 +0000 Subject: [PATCH 09/11] sync with cpython 4c810f92 --- library/asyncio-eventloop.po | 406 ++++++++++++++++++----------------- reference/compound_stmts.po | 22 +- 2 files changed, 216 insertions(+), 212 deletions(-) diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 24497cba2ff..db4a953fc71 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-12-07 00:17+0000\n" +"POT-Creation-Date: 2022-12-17 00:14+0000\n" "PO-Revision-Date: 2022-02-20 12:36+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -266,8 +266,8 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:182 -#: ../../library/asyncio-eventloop.rst:1210 -#: ../../library/asyncio-eventloop.rst:1598 +#: ../../library/asyncio-eventloop.rst:1212 +#: ../../library/asyncio-eventloop.rst:1600 msgid "Example::" msgstr "" "範例:\n" @@ -517,8 +517,8 @@ msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." msgstr "" #: ../../library/asyncio-eventloop.rst:402 -#: ../../library/asyncio-eventloop.rst:1126 -#: ../../library/asyncio-eventloop.rst:1142 +#: ../../library/asyncio-eventloop.rst:1128 +#: ../../library/asyncio-eventloop.rst:1144 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." @@ -854,7 +854,7 @@ msgstr "" #: ../../library/asyncio-eventloop.rst:630 #: ../../library/asyncio-eventloop.rst:770 -#: ../../library/asyncio-eventloop.rst:1193 +#: ../../library/asyncio-eventloop.rst:1195 msgid ":ref:`Availability `: Unix." msgstr ":ref:`適用 `:Unix。" @@ -1080,7 +1080,7 @@ msgid "*file* must be a regular file object opened in binary mode." msgstr "" #: ../../library/asyncio-eventloop.rst:841 -#: ../../library/asyncio-eventloop.rst:1081 +#: ../../library/asyncio-eventloop.rst:1083 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1158,37 +1158,41 @@ msgid "" msgstr "" #: ../../library/asyncio-eventloop.rst:918 -msgid "Stop monitoring the *fd* file descriptor for read availability." +msgid "" +"Stop monitoring the *fd* file descriptor for read availability. Returns " +"``True`` if *fd* was previously being monitored for reads." msgstr "" -#: ../../library/asyncio-eventloop.rst:922 +#: ../../library/asyncio-eventloop.rst:923 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." msgstr "" -#: ../../library/asyncio-eventloop.rst:926 -#: ../../library/asyncio-eventloop.rst:1180 +#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:1182 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." msgstr "" -#: ../../library/asyncio-eventloop.rst:931 -msgid "Stop monitoring the *fd* file descriptor for write availability." +#: ../../library/asyncio-eventloop.rst:932 +msgid "" +"Stop monitoring the *fd* file descriptor for write availability. Returns " +"``True`` if *fd* was previously being monitored for writes." msgstr "" -#: ../../library/asyncio-eventloop.rst:933 +#: ../../library/asyncio-eventloop.rst:935 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:938 +#: ../../library/asyncio-eventloop.rst:940 msgid "Working with socket objects directly" msgstr "" -#: ../../library/asyncio-eventloop.rst:940 +#: ../../library/asyncio-eventloop.rst:942 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1197,72 +1201,72 @@ msgid "" "socket` objects directly is more convenient." msgstr "" -#: ../../library/asyncio-eventloop.rst:949 +#: ../../library/asyncio-eventloop.rst:951 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:952 +#: ../../library/asyncio-eventloop.rst:954 msgid "Return the received data as a bytes object." msgstr "" -#: ../../library/asyncio-eventloop.rst:954 -#: ../../library/asyncio-eventloop.rst:968 -#: ../../library/asyncio-eventloop.rst:979 -#: ../../library/asyncio-eventloop.rst:991 -#: ../../library/asyncio-eventloop.rst:1006 -#: ../../library/asyncio-eventloop.rst:1021 -#: ../../library/asyncio-eventloop.rst:1031 -#: ../../library/asyncio-eventloop.rst:1057 -#: ../../library/asyncio-eventloop.rst:1095 +#: ../../library/asyncio-eventloop.rst:956 +#: ../../library/asyncio-eventloop.rst:970 +#: ../../library/asyncio-eventloop.rst:981 +#: ../../library/asyncio-eventloop.rst:993 +#: ../../library/asyncio-eventloop.rst:1008 +#: ../../library/asyncio-eventloop.rst:1023 +#: ../../library/asyncio-eventloop.rst:1033 +#: ../../library/asyncio-eventloop.rst:1059 +#: ../../library/asyncio-eventloop.rst:1097 msgid "*sock* must be a non-blocking socket." msgstr "" -#: ../../library/asyncio-eventloop.rst:956 +#: ../../library/asyncio-eventloop.rst:958 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " "is an ``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:963 +#: ../../library/asyncio-eventloop.rst:965 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:966 +#: ../../library/asyncio-eventloop.rst:968 msgid "Return the number of bytes written to the buffer." msgstr "" -#: ../../library/asyncio-eventloop.rst:974 +#: ../../library/asyncio-eventloop.rst:976 msgid "" "Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" "meth:`socket.recvfrom() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:977 +#: ../../library/asyncio-eventloop.rst:979 msgid "Return a tuple of (received data, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:985 +#: ../../library/asyncio-eventloop.rst:987 msgid "" "Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " "version of :meth:`socket.recvfrom_into() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:989 +#: ../../library/asyncio-eventloop.rst:991 msgid "Return a tuple of (number of bytes received, remote address)." msgstr "" -#: ../../library/asyncio-eventloop.rst:997 +#: ../../library/asyncio-eventloop.rst:999 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1000 +#: ../../library/asyncio-eventloop.rst:1002 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1271,34 +1275,34 @@ msgid "" "the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1008 -#: ../../library/asyncio-eventloop.rst:1059 +#: ../../library/asyncio-eventloop.rst:1010 +#: ../../library/asyncio-eventloop.rst:1061 msgid "" "Even though the method was always documented as a coroutine method, before " "Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1015 +#: ../../library/asyncio-eventloop.rst:1017 msgid "" "Send a datagram from *sock* to *address*. Asynchronous version of :meth:" "`socket.sendto() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1019 +#: ../../library/asyncio-eventloop.rst:1021 msgid "Return the number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1027 +#: ../../library/asyncio-eventloop.rst:1029 msgid "Connect *sock* to a remote socket at *address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1029 +#: ../../library/asyncio-eventloop.rst:1031 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1033 +#: ../../library/asyncio-eventloop.rst:1035 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1306,19 +1310,19 @@ msgid "" "*address*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1042 +#: ../../library/asyncio-eventloop.rst:1044 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1048 +#: ../../library/asyncio-eventloop.rst:1050 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1051 +#: ../../library/asyncio-eventloop.rst:1053 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1326,57 +1330,57 @@ msgid "" "the address bound to the socket on the other end of the connection." msgstr "" -#: ../../library/asyncio-eventloop.rst:1066 +#: ../../library/asyncio-eventloop.rst:1068 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` 和 :func:`start_server`\\ 。" -#: ../../library/asyncio-eventloop.rst:1071 +#: ../../library/asyncio-eventloop.rst:1073 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." msgstr "" -#: ../../library/asyncio-eventloop.rst:1074 +#: ../../library/asyncio-eventloop.rst:1076 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1076 +#: ../../library/asyncio-eventloop.rst:1078 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1079 +#: ../../library/asyncio-eventloop.rst:1081 msgid "*file* must be a regular file object open in binary mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1088 +#: ../../library/asyncio-eventloop.rst:1090 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " "or SSL socket on Unix)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1092 +#: ../../library/asyncio-eventloop.rst:1094 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1101 +#: ../../library/asyncio-eventloop.rst:1103 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1106 +#: ../../library/asyncio-eventloop.rst:1108 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1110 +#: ../../library/asyncio-eventloop.rst:1112 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1112 +#: ../../library/asyncio-eventloop.rst:1114 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1384,67 +1388,67 @@ msgid "" "coroutines." msgstr "" -#: ../../library/asyncio-eventloop.rst:1120 +#: ../../library/asyncio-eventloop.rst:1122 msgid "Working with pipes" msgstr "" -#: ../../library/asyncio-eventloop.rst:1124 +#: ../../library/asyncio-eventloop.rst:1126 msgid "Register the read end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1129 +#: ../../library/asyncio-eventloop.rst:1131 msgid "*pipe* is a :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1131 +#: ../../library/asyncio-eventloop.rst:1133 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1135 -#: ../../library/asyncio-eventloop.rst:1151 +#: ../../library/asyncio-eventloop.rst:1137 +#: ../../library/asyncio-eventloop.rst:1153 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1140 +#: ../../library/asyncio-eventloop.rst:1142 msgid "Register the write end of *pipe* in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1145 +#: ../../library/asyncio-eventloop.rst:1147 msgid "*pipe* is :term:`file-like object `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1147 +#: ../../library/asyncio-eventloop.rst:1149 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " "*protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1156 +#: ../../library/asyncio-eventloop.rst:1158 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1161 +#: ../../library/asyncio-eventloop.rst:1163 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" -#: ../../library/asyncio-eventloop.rst:1166 +#: ../../library/asyncio-eventloop.rst:1168 msgid "Unix signals" msgstr "" -#: ../../library/asyncio-eventloop.rst:1170 +#: ../../library/asyncio-eventloop.rst:1172 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1172 +#: ../../library/asyncio-eventloop.rst:1174 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1452,46 +1456,46 @@ msgid "" "function is allowed to interact with the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1177 +#: ../../library/asyncio-eventloop.rst:1179 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1183 +#: ../../library/asyncio-eventloop.rst:1185 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" -#: ../../library/asyncio-eventloop.rst:1188 +#: ../../library/asyncio-eventloop.rst:1190 msgid "Remove the handler for the *sig* signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1190 +#: ../../library/asyncio-eventloop.rst:1192 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." msgstr "" -#: ../../library/asyncio-eventloop.rst:1197 +#: ../../library/asyncio-eventloop.rst:1199 msgid "The :mod:`signal` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1201 +#: ../../library/asyncio-eventloop.rst:1203 msgid "Executing code in thread or process pools" msgstr "" -#: ../../library/asyncio-eventloop.rst:1205 +#: ../../library/asyncio-eventloop.rst:1207 msgid "Arrange for *func* to be called in the specified executor." msgstr "" -#: ../../library/asyncio-eventloop.rst:1207 +#: ../../library/asyncio-eventloop.rst:1209 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " "instance. The default executor is used if *executor* is ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1252 +#: ../../library/asyncio-eventloop.rst:1254 msgid "" "Note that the entry point guard (``if __name__ == '__main__'``) is required " "for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " @@ -1499,17 +1503,17 @@ msgid "" "importing of main module `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1257 +#: ../../library/asyncio-eventloop.rst:1259 msgid "This method returns a :class:`asyncio.Future` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1259 +#: ../../library/asyncio-eventloop.rst:1261 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1262 +#: ../../library/asyncio-eventloop.rst:1264 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -1517,32 +1521,32 @@ msgid "" "default." msgstr "" -#: ../../library/asyncio-eventloop.rst:1271 +#: ../../library/asyncio-eventloop.rst:1273 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1275 +#: ../../library/asyncio-eventloop.rst:1277 msgid "" "*executor* must be an instance of :class:`~concurrent.futures." "ThreadPoolExecutor`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1281 +#: ../../library/asyncio-eventloop.rst:1283 msgid "Error Handling API" msgstr "" -#: ../../library/asyncio-eventloop.rst:1283 +#: ../../library/asyncio-eventloop.rst:1285 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1287 +#: ../../library/asyncio-eventloop.rst:1289 msgid "Set *handler* as the new event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1289 +#: ../../library/asyncio-eventloop.rst:1291 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -1551,158 +1555,158 @@ msgid "" "(see :meth:`call_exception_handler` documentation for details about context)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1299 +#: ../../library/asyncio-eventloop.rst:1301 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." msgstr "" -#: ../../library/asyncio-eventloop.rst:1306 +#: ../../library/asyncio-eventloop.rst:1308 msgid "Default exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1308 +#: ../../library/asyncio-eventloop.rst:1310 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " "default handler behavior." msgstr "" -#: ../../library/asyncio-eventloop.rst:1312 +#: ../../library/asyncio-eventloop.rst:1314 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1317 +#: ../../library/asyncio-eventloop.rst:1319 msgid "Call the current event loop exception handler." msgstr "" -#: ../../library/asyncio-eventloop.rst:1319 +#: ../../library/asyncio-eventloop.rst:1321 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" msgstr "" -#: ../../library/asyncio-eventloop.rst:1322 +#: ../../library/asyncio-eventloop.rst:1324 msgid "'message': Error message;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1323 +#: ../../library/asyncio-eventloop.rst:1325 msgid "'exception' (optional): Exception object;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1324 +#: ../../library/asyncio-eventloop.rst:1326 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1325 +#: ../../library/asyncio-eventloop.rst:1327 msgid "'task' (optional): :class:`asyncio.Task` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1326 +#: ../../library/asyncio-eventloop.rst:1328 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1327 +#: ../../library/asyncio-eventloop.rst:1329 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1328 +#: ../../library/asyncio-eventloop.rst:1330 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1329 +#: ../../library/asyncio-eventloop.rst:1331 msgid "'socket' (optional): :class:`socket.socket` instance;" msgstr "" -#: ../../library/asyncio-eventloop.rst:1331 +#: ../../library/asyncio-eventloop.rst:1333 msgid "'asyncgen' (optional): Asynchronous generator that caused" msgstr "" -#: ../../library/asyncio-eventloop.rst:1331 +#: ../../library/asyncio-eventloop.rst:1333 msgid "the exception." msgstr "" -#: ../../library/asyncio-eventloop.rst:1335 +#: ../../library/asyncio-eventloop.rst:1337 msgid "" "This method should not be overloaded in subclassed event loops. For custom " "exception handling, use the :meth:`set_exception_handler()` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1340 +#: ../../library/asyncio-eventloop.rst:1342 msgid "Enabling debug mode" msgstr "" -#: ../../library/asyncio-eventloop.rst:1344 +#: ../../library/asyncio-eventloop.rst:1346 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1346 +#: ../../library/asyncio-eventloop.rst:1348 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." msgstr "" -#: ../../library/asyncio-eventloop.rst:1352 +#: ../../library/asyncio-eventloop.rst:1354 msgid "Set the debug mode of the event loop." msgstr "" -#: ../../library/asyncio-eventloop.rst:1356 +#: ../../library/asyncio-eventloop.rst:1358 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." msgstr "" -#: ../../library/asyncio-eventloop.rst:1361 +#: ../../library/asyncio-eventloop.rst:1363 msgid "The :ref:`debug mode of asyncio `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1365 +#: ../../library/asyncio-eventloop.rst:1367 msgid "Running Subprocesses" msgstr "" -#: ../../library/asyncio-eventloop.rst:1367 +#: ../../library/asyncio-eventloop.rst:1369 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " "and :func:`asyncio.create_subprocess_exec` convenience functions instead." msgstr "" -#: ../../library/asyncio-eventloop.rst:1374 +#: ../../library/asyncio-eventloop.rst:1376 msgid "" "On Windows, the default event loop :class:`ProactorEventLoop` supports " "subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" "`Subprocess Support on Windows ` for details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1383 +#: ../../library/asyncio-eventloop.rst:1385 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1386 +#: ../../library/asyncio-eventloop.rst:1388 msgid "*args* must be a list of strings represented by:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1388 +#: ../../library/asyncio-eventloop.rst:1390 msgid ":class:`str`;" msgstr ":class:`str`\\ ;" -#: ../../library/asyncio-eventloop.rst:1389 +#: ../../library/asyncio-eventloop.rst:1391 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." msgstr "" -#: ../../library/asyncio-eventloop.rst:1392 +#: ../../library/asyncio-eventloop.rst:1394 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " "program." msgstr "" -#: ../../library/asyncio-eventloop.rst:1396 +#: ../../library/asyncio-eventloop.rst:1398 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -1710,136 +1714,136 @@ msgid "" "which is list of strings, *subprocess_exec* takes multiple string arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1402 +#: ../../library/asyncio-eventloop.rst:1404 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1405 +#: ../../library/asyncio-eventloop.rst:1407 msgid "Other parameters:" msgstr "其他參數:" -#: ../../library/asyncio-eventloop.rst:1407 +#: ../../library/asyncio-eventloop.rst:1409 msgid "*stdin* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1409 +#: ../../library/asyncio-eventloop.rst:1411 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard input stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1412 -#: ../../library/asyncio-eventloop.rst:1424 -#: ../../library/asyncio-eventloop.rst:1436 +#: ../../library/asyncio-eventloop.rst:1414 +#: ../../library/asyncio-eventloop.rst:1426 +#: ../../library/asyncio-eventloop.rst:1438 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," msgstr "" -#: ../../library/asyncio-eventloop.rst:1414 -#: ../../library/asyncio-eventloop.rst:1426 -#: ../../library/asyncio-eventloop.rst:1438 +#: ../../library/asyncio-eventloop.rst:1416 +#: ../../library/asyncio-eventloop.rst:1428 +#: ../../library/asyncio-eventloop.rst:1440 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" msgstr "" -#: ../../library/asyncio-eventloop.rst:1416 -#: ../../library/asyncio-eventloop.rst:1428 -#: ../../library/asyncio-eventloop.rst:1440 +#: ../../library/asyncio-eventloop.rst:1418 +#: ../../library/asyncio-eventloop.rst:1430 +#: ../../library/asyncio-eventloop.rst:1442 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" msgstr "" -#: ../../library/asyncio-eventloop.rst:1419 +#: ../../library/asyncio-eventloop.rst:1421 msgid "*stdout* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1421 +#: ../../library/asyncio-eventloop.rst:1423 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard output stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1431 +#: ../../library/asyncio-eventloop.rst:1433 msgid "*stderr* can be any of these:" msgstr "" -#: ../../library/asyncio-eventloop.rst:1433 +#: ../../library/asyncio-eventloop.rst:1435 msgid "" "a file-like object representing a pipe to be connected to the subprocess's " "standard error stream using :meth:`~loop.connect_write_pipe`" msgstr "" -#: ../../library/asyncio-eventloop.rst:1442 +#: ../../library/asyncio-eventloop.rst:1444 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" msgstr "" -#: ../../library/asyncio-eventloop.rst:1445 +#: ../../library/asyncio-eventloop.rst:1447 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " "*encoding* and *errors*, which should not be specified at all." msgstr "" -#: ../../library/asyncio-eventloop.rst:1450 +#: ../../library/asyncio-eventloop.rst:1452 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -#: ../../library/asyncio-eventloop.rst:1454 +#: ../../library/asyncio-eventloop.rst:1456 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1457 +#: ../../library/asyncio-eventloop.rst:1459 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " "object instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1465 +#: ../../library/asyncio-eventloop.rst:1467 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding `, using the platform's \"shell\" syntax." msgstr "" -#: ../../library/asyncio-eventloop.rst:1470 +#: ../../library/asyncio-eventloop.rst:1472 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1473 +#: ../../library/asyncio-eventloop.rst:1475 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." msgstr "" -#: ../../library/asyncio-eventloop.rst:1476 +#: ../../library/asyncio-eventloop.rst:1478 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." msgstr "" -#: ../../library/asyncio-eventloop.rst:1479 +#: ../../library/asyncio-eventloop.rst:1481 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -#: ../../library/asyncio-eventloop.rst:1484 +#: ../../library/asyncio-eventloop.rst:1486 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -1849,105 +1853,105 @@ msgid "" "used to construct shell commands." msgstr "" -#: ../../library/asyncio-eventloop.rst:1493 +#: ../../library/asyncio-eventloop.rst:1495 msgid "Callback Handles" msgstr "" -#: ../../library/asyncio-eventloop.rst:1497 +#: ../../library/asyncio-eventloop.rst:1499 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1502 +#: ../../library/asyncio-eventloop.rst:1504 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." msgstr "" -#: ../../library/asyncio-eventloop.rst:1507 +#: ../../library/asyncio-eventloop.rst:1509 msgid "Return ``True`` if the callback was cancelled." msgstr "" -#: ../../library/asyncio-eventloop.rst:1513 +#: ../../library/asyncio-eventloop.rst:1515 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1516 +#: ../../library/asyncio-eventloop.rst:1518 msgid "This class is a subclass of :class:`Handle`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1520 +#: ../../library/asyncio-eventloop.rst:1522 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "" -#: ../../library/asyncio-eventloop.rst:1522 +#: ../../library/asyncio-eventloop.rst:1524 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1529 +#: ../../library/asyncio-eventloop.rst:1531 msgid "Server Objects" msgstr "" -#: ../../library/asyncio-eventloop.rst:1531 +#: ../../library/asyncio-eventloop.rst:1533 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " "functions." msgstr "" -#: ../../library/asyncio-eventloop.rst:1535 +#: ../../library/asyncio-eventloop.rst:1537 msgid "Do not instantiate the class directly." msgstr "" -#: ../../library/asyncio-eventloop.rst:1539 +#: ../../library/asyncio-eventloop.rst:1541 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " "accepting new connections when the ``async with`` statement is completed::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1552 +#: ../../library/asyncio-eventloop.rst:1554 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" -#: ../../library/asyncio-eventloop.rst:1557 +#: ../../library/asyncio-eventloop.rst:1559 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." msgstr "" -#: ../../library/asyncio-eventloop.rst:1560 +#: ../../library/asyncio-eventloop.rst:1562 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "" -#: ../../library/asyncio-eventloop.rst:1563 +#: ../../library/asyncio-eventloop.rst:1565 msgid "" "The server is closed asynchronously, use the :meth:`wait_closed` coroutine " "to wait until the server is closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1568 +#: ../../library/asyncio-eventloop.rst:1570 msgid "Return the event loop associated with the server object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1574 +#: ../../library/asyncio-eventloop.rst:1576 msgid "Start accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1576 +#: ../../library/asyncio-eventloop.rst:1578 msgid "" "This method is idempotent, so it can be called when the server is already " "serving." msgstr "" -#: ../../library/asyncio-eventloop.rst:1579 +#: ../../library/asyncio-eventloop.rst:1581 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -1956,96 +1960,96 @@ msgid "" "accepting connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1590 +#: ../../library/asyncio-eventloop.rst:1592 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." msgstr "" -#: ../../library/asyncio-eventloop.rst:1594 +#: ../../library/asyncio-eventloop.rst:1596 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." msgstr "" -#: ../../library/asyncio-eventloop.rst:1616 +#: ../../library/asyncio-eventloop.rst:1618 msgid "Return ``True`` if the server is accepting new connections." msgstr "" -#: ../../library/asyncio-eventloop.rst:1622 +#: ../../library/asyncio-eventloop.rst:1624 msgid "Wait until the :meth:`close` method completes." msgstr "" -#: ../../library/asyncio-eventloop.rst:1626 +#: ../../library/asyncio-eventloop.rst:1628 msgid "List of :class:`socket.socket` objects the server is listening on." msgstr "" -#: ../../library/asyncio-eventloop.rst:1628 +#: ../../library/asyncio-eventloop.rst:1630 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." msgstr "" -#: ../../library/asyncio-eventloop.rst:1638 +#: ../../library/asyncio-eventloop.rst:1640 msgid "Event Loop Implementations" msgstr "" -#: ../../library/asyncio-eventloop.rst:1640 +#: ../../library/asyncio-eventloop.rst:1642 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1643 +#: ../../library/asyncio-eventloop.rst:1645 msgid "" "By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " "and :class:`ProactorEventLoop` on Windows." msgstr "" -#: ../../library/asyncio-eventloop.rst:1649 +#: ../../library/asyncio-eventloop.rst:1651 msgid "An event loop based on the :mod:`selectors` module." msgstr "" -#: ../../library/asyncio-eventloop.rst:1651 +#: ../../library/asyncio-eventloop.rst:1653 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " "used::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1666 +#: ../../library/asyncio-eventloop.rst:1668 msgid ":ref:`Availability `: Unix, Windows." msgstr ":ref:`適用 `:Unix、Windows。" -#: ../../library/asyncio-eventloop.rst:1671 +#: ../../library/asyncio-eventloop.rst:1673 msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." msgstr "" -#: ../../library/asyncio-eventloop.rst:1674 +#: ../../library/asyncio-eventloop.rst:1676 msgid ":ref:`Availability `: Windows." msgstr ":ref:`適用 `:Windows。" -#: ../../library/asyncio-eventloop.rst:1677 +#: ../../library/asyncio-eventloop.rst:1679 msgid "" "`MSDN documentation on I/O Completion Ports `_." msgstr "" -#: ../../library/asyncio-eventloop.rst:1683 +#: ../../library/asyncio-eventloop.rst:1685 msgid "Abstract base class for asyncio-compliant event loops." msgstr "" -#: ../../library/asyncio-eventloop.rst:1685 +#: ../../library/asyncio-eventloop.rst:1687 msgid "" "The :ref:`asyncio-event-loop-methods` section lists all methods that an " "alternative implementation of ``AbstractEventLoop`` should have defined." msgstr "" -#: ../../library/asyncio-eventloop.rst:1691 +#: ../../library/asyncio-eventloop.rst:1693 msgid "Examples" msgstr "範例" -#: ../../library/asyncio-eventloop.rst:1693 +#: ../../library/asyncio-eventloop.rst:1695 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2053,70 +2057,70 @@ msgid "" "consider using the high-level functions like :func:`asyncio.run`." msgstr "" -#: ../../library/asyncio-eventloop.rst:1703 +#: ../../library/asyncio-eventloop.rst:1705 msgid "Hello World with call_soon()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1705 +#: ../../library/asyncio-eventloop.rst:1707 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1729 +#: ../../library/asyncio-eventloop.rst:1731 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1736 +#: ../../library/asyncio-eventloop.rst:1738 msgid "Display the current date with call_later()" msgstr "" -#: ../../library/asyncio-eventloop.rst:1738 +#: ../../library/asyncio-eventloop.rst:1740 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " "5 seconds, and then stops the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1766 +#: ../../library/asyncio-eventloop.rst:1768 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." msgstr "" -#: ../../library/asyncio-eventloop.rst:1773 +#: ../../library/asyncio-eventloop.rst:1775 msgid "Watch a file descriptor for read events" msgstr "" -#: ../../library/asyncio-eventloop.rst:1775 +#: ../../library/asyncio-eventloop.rst:1777 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" msgstr "" -#: ../../library/asyncio-eventloop.rst:1813 +#: ../../library/asyncio-eventloop.rst:1815 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." msgstr "" -#: ../../library/asyncio-eventloop.rst:1817 +#: ../../library/asyncio-eventloop.rst:1819 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." msgstr "" -#: ../../library/asyncio-eventloop.rst:1825 +#: ../../library/asyncio-eventloop.rst:1827 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "" -#: ../../library/asyncio-eventloop.rst:1827 +#: ../../library/asyncio-eventloop.rst:1829 msgid "(This ``signals`` example only works on Unix.)" msgstr "" -#: ../../library/asyncio-eventloop.rst:1829 +#: ../../library/asyncio-eventloop.rst:1831 msgid "" "Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " "the :meth:`loop.add_signal_handler` method::" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 0489b7d0068..068ab4d4a6a 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-04 00:20+0000\n" +"POT-Creation-Date: 2022-12-17 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -278,15 +278,15 @@ msgstr "" #: ../../reference/compound_stmts.rst:340 msgid "" -"The :keyword:`!except*` clause(s) are used for handling :exc:`ExceptionGroup`" -"\\s. The exception type for matching is interpreted as in the case of :" -"keyword:`except`, but in the case of exception groups we can have partial " -"matches when the type matches some of the exceptions in the group. This " -"means that multiple :keyword:`!except*` clauses can execute, each handling " -"part of the exception group. Each clause executes at most once and handles " -"an exception group of all matching exceptions. Each exception in the group " -"is handled by at most one :keyword:`!except*` clause, the first that matches " -"it. ::" +"The :keyword:`!except*` clause(s) are used for handling :exc:" +"`ExceptionGroup`\\s. The exception type for matching is interpreted as in " +"the case of :keyword:`except`, but in the case of exception groups we can " +"have partial matches when the type matches some of the exceptions in the " +"group. This means that multiple :keyword:`!except*` clauses can execute, " +"each handling part of the exception group. Each clause executes at most once " +"and handles an exception group of all matching exceptions. Each exception " +"in the group is handled by at most one :keyword:`!except*` clause, the first " +"that matches it. ::" msgstr "" #: ../../reference/compound_stmts.rst:368 @@ -419,7 +419,7 @@ msgid "" "method returns without an error, then :meth:`__exit__` will always be " "called. Thus, if an error occurs during the assignment to the target list, " "it will be treated the same as an error occurring within the suite would be. " -"See step 6 below." +"See step 7 below." msgstr "" #: ../../reference/compound_stmts.rst:511 From af9aa24103ffe4b69a5e31eac7c024ab4d8cc28a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 18 Dec 2022 00:18:33 +0000 Subject: [PATCH 10/11] sync with cpython bf0a334c --- c-api/apiabiversion.po | 10 +- c-api/structures.po | 275 +++++++++++++++++------------------ library/zipfile.po | 317 +++++++++++++++++++++-------------------- 3 files changed, 300 insertions(+), 302 deletions(-) diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index d2ddcc91bcb..cd1679a48ec 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-12-18 00:16+0000\n" "PO-Revision-Date: 2022-01-24 22:34+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -173,16 +173,20 @@ msgstr "" "hexversion ``0x030a00f0``\\ 。" #: ../../c-api/apiabiversion.rst:61 +msgid "Use this for numeric comparisons, e.g. ``#if PY_VERSION_HEX >= ...``." +msgstr "" + +#: ../../c-api/apiabiversion.rst:63 msgid "This version is also available via the symbol :data:`Py_Version`." msgstr "" -#: ../../c-api/apiabiversion.rst:65 +#: ../../c-api/apiabiversion.rst:67 msgid "" "The Python runtime version number encoded in a single constant integer, with " "the same format as the :c:macro:`PY_VERSION_HEX` macro. This contains the " "Python version used at run time." msgstr "" -#: ../../c-api/apiabiversion.rst:71 +#: ../../c-api/apiabiversion.rst:73 msgid "All the given macros are defined in :source:`Include/patchlevel.h`." msgstr "所有提到的巨集都定義在 :source:`Include/patchlevel.h`\\ 。" diff --git a/c-api/structures.po b/c-api/structures.po index 1add53e04ac..2f5485846c2 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-12-18 00:16+0000\n" "PO-Revision-Date: 2018-05-23 14:07+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -236,72 +236,25 @@ msgid "" "has four fields:" msgstr "" -#: ../../c-api/structures.rst:251 ../../c-api/structures.rst:410 -#: ../../c-api/structures.rst:506 -msgid "Field" -msgstr "" - -#: ../../c-api/structures.rst:251 ../../c-api/structures.rst:410 -#: ../../c-api/structures.rst:506 -msgid "C Type" -msgstr "C Type" - -#: ../../c-api/structures.rst:251 ../../c-api/structures.rst:410 -#: ../../c-api/structures.rst:506 -msgid "Meaning" -msgstr "" - -#: ../../c-api/structures.rst:253 -msgid ":attr:`ml_name`" -msgstr ":attr:`ml_name`" - -#: ../../c-api/structures.rst:253 ../../c-api/structures.rst:261 -#: ../../c-api/structures.rst:412 ../../c-api/structures.rst:425 -#: ../../c-api/structures.rst:441 ../../c-api/structures.rst:508 -#: ../../c-api/structures.rst:516 -msgid "const char \\*" -msgstr "const char \\*" - -#: ../../c-api/structures.rst:253 +#: ../../c-api/structures.rst:252 msgid "name of the method" msgstr "" -#: ../../c-api/structures.rst:255 -msgid ":attr:`ml_meth`" -msgstr ":attr:`ml_meth`" - -#: ../../c-api/structures.rst:255 -msgid "PyCFunction" -msgstr "PyCFunction" - -#: ../../c-api/structures.rst:255 +#: ../../c-api/structures.rst:256 msgid "pointer to the C implementation" msgstr "" -#: ../../c-api/structures.rst:258 -msgid ":attr:`ml_flags`" -msgstr ":attr:`ml_flags`" - -#: ../../c-api/structures.rst:258 ../../c-api/structures.rst:414 -#: ../../c-api/structures.rst:421 ../../c-api/structures.rst:437 -msgid "int" -msgstr "int" - -#: ../../c-api/structures.rst:258 -msgid "flag bits indicating how the call should be constructed" +#: ../../c-api/structures.rst:260 +msgid "flags bits indicating how the call should be constructed" msgstr "" -#: ../../c-api/structures.rst:261 -msgid ":attr:`ml_doc`" -msgstr ":attr:`ml_doc`" - -#: ../../c-api/structures.rst:261 ../../c-api/structures.rst:425 +#: ../../c-api/structures.rst:264 ../../c-api/structures.rst:426 msgid "points to the contents of the docstring" msgstr "" -#: ../../c-api/structures.rst:265 +#: ../../c-api/structures.rst:266 msgid "" -"The :attr:`ml_meth` is a C function pointer. The functions may be of " +"The :c:member:`ml_meth` is a C function pointer. The functions may be of " "different types, but they always return :c:expr:`PyObject*`. If the " "function is not of the :c:type:`PyCFunction`, the compiler will require a " "cast in the method table. Even though :c:type:`PyCFunction` defines the " @@ -309,18 +262,18 @@ msgid "" "implementation uses the specific C type of the *self* object." msgstr "" -#: ../../c-api/structures.rst:272 +#: ../../c-api/structures.rst:273 msgid "" -"The :attr:`ml_flags` field is a bitfield which can include the following " +"The :c:member:`ml_flags` field is a bitfield which can include the following " "flags. The individual flags indicate either a calling convention or a " "binding convention." msgstr "" -#: ../../c-api/structures.rst:276 +#: ../../c-api/structures.rst:277 msgid "There are these calling conventions:" msgstr "" -#: ../../c-api/structures.rst:280 +#: ../../c-api/structures.rst:281 msgid "" "This is the typical calling convention, where the methods have the type :c:" "type:`PyCFunction`. The function expects two :c:expr:`PyObject*` values. The " @@ -330,7 +283,7 @@ msgid "" "func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`." msgstr "" -#: ../../c-api/structures.rst:290 +#: ../../c-api/structures.rst:291 msgid "" "Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. " "The function expects three parameters: *self*, *args*, *kwargs* where " @@ -339,7 +292,7 @@ msgid "" "using :c:func:`PyArg_ParseTupleAndKeywords`." msgstr "" -#: ../../c-api/structures.rst:299 +#: ../../c-api/structures.rst:300 msgid "" "Fast calling convention supporting only positional arguments. The methods " "have the type :c:type:`_PyCFunctionFast`. The first parameter is *self*, the " @@ -348,11 +301,11 @@ msgid "" "the array)." msgstr "" -#: ../../c-api/structures.rst:309 +#: ../../c-api/structures.rst:310 msgid "``METH_FASTCALL`` is now part of the stable ABI." msgstr "" -#: ../../c-api/structures.rst:314 +#: ../../c-api/structures.rst:315 msgid "" "Extension of :const:`METH_FASTCALL` supporting also keyword arguments, with " "methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword arguments " @@ -364,21 +317,21 @@ msgid "" "arguments." msgstr "" -#: ../../c-api/structures.rst:329 +#: ../../c-api/structures.rst:330 msgid "" "Extension of :const:`METH_FASTCALL | METH_KEYWORDS` supporting the *defining " "class*, that is, the class that contains the method in question. The " "defining class might be a superclass of ``Py_TYPE(self)``." msgstr "" -#: ../../c-api/structures.rst:333 +#: ../../c-api/structures.rst:334 msgid "" "The method needs to be of type :c:type:`PyCMethod`, the same as for " "``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added " "after ``self``." msgstr "" -#: ../../c-api/structures.rst:342 +#: ../../c-api/structures.rst:343 msgid "" "Methods without parameters don't need to check whether arguments are given " "if they are listed with the :const:`METH_NOARGS` flag. They need to be of " @@ -387,13 +340,13 @@ msgid "" "the second parameter will be ``NULL``." msgstr "" -#: ../../c-api/structures.rst:348 +#: ../../c-api/structures.rst:349 msgid "" "The function must have 2 parameters. Since the second parameter is unused, :" "c:macro:`Py_UNUSED` can be used to prevent a compiler warning." msgstr "" -#: ../../c-api/structures.rst:354 +#: ../../c-api/structures.rst:355 msgid "" "Methods with a single object argument can be listed with the :const:`METH_O` " "flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``\"O\"`` " @@ -402,7 +355,7 @@ msgid "" "argument." msgstr "" -#: ../../c-api/structures.rst:360 +#: ../../c-api/structures.rst:361 msgid "" "These two constants are not used to indicate the calling convention but the " "binding when use with methods of classes. These may not be used for " @@ -410,27 +363,27 @@ msgid "" "any given method." msgstr "" -#: ../../c-api/structures.rst:370 +#: ../../c-api/structures.rst:371 msgid "" "The method will be passed the type object as the first parameter rather than " "an instance of the type. This is used to create *class methods*, similar to " "what is created when using the :func:`classmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:380 +#: ../../c-api/structures.rst:381 msgid "" "The method will be passed ``NULL`` as the first parameter rather than an " "instance of the type. This is used to create *static methods*, similar to " "what is created when using the :func:`staticmethod` built-in function." msgstr "" -#: ../../c-api/structures.rst:384 +#: ../../c-api/structures.rst:385 msgid "" "One other constant controls whether a method is loaded in place of another " "definition with the same method name." msgstr "" -#: ../../c-api/structures.rst:390 +#: ../../c-api/structures.rst:391 msgid "" "The method will be loaded in place of existing definitions. Without " "*METH_COEXIST*, the default is to skip repeated definitions. Since slot " @@ -443,194 +396,217 @@ msgid "" "calls." msgstr "" -#: ../../c-api/structures.rst:402 +#: ../../c-api/structures.rst:403 msgid "Accessing attributes of extension types" msgstr "" -#: ../../c-api/structures.rst:406 +#: ../../c-api/structures.rst:407 msgid "" "Structure which describes an attribute of a type which corresponds to a C " "struct member. Its fields are:" msgstr "" -#: ../../c-api/structures.rst:412 +#: ../../c-api/structures.rst:411 ../../c-api/structures.rst:507 +msgid "Field" +msgstr "" + +#: ../../c-api/structures.rst:411 ../../c-api/structures.rst:507 +msgid "C Type" +msgstr "C Type" + +#: ../../c-api/structures.rst:411 ../../c-api/structures.rst:507 +msgid "Meaning" +msgstr "" + +#: ../../c-api/structures.rst:413 msgid ":attr:`name`" msgstr ":attr:`name`" -#: ../../c-api/structures.rst:412 +#: ../../c-api/structures.rst:413 ../../c-api/structures.rst:426 +#: ../../c-api/structures.rst:442 ../../c-api/structures.rst:509 +#: ../../c-api/structures.rst:517 +msgid "const char \\*" +msgstr "const char \\*" + +#: ../../c-api/structures.rst:413 msgid "name of the member" msgstr "" -#: ../../c-api/structures.rst:414 +#: ../../c-api/structures.rst:415 msgid ":attr:`!type`" msgstr ":attr:`!type`" -#: ../../c-api/structures.rst:414 +#: ../../c-api/structures.rst:415 ../../c-api/structures.rst:422 +#: ../../c-api/structures.rst:438 +msgid "int" +msgstr "int" + +#: ../../c-api/structures.rst:415 msgid "the type of the member in the C struct" msgstr "" -#: ../../c-api/structures.rst:417 +#: ../../c-api/structures.rst:418 msgid ":attr:`offset`" msgstr ":attr:`offset`" -#: ../../c-api/structures.rst:417 ../../c-api/structures.rst:453 +#: ../../c-api/structures.rst:418 ../../c-api/structures.rst:454 msgid "Py_ssize_t" msgstr "Py_ssize_t" -#: ../../c-api/structures.rst:417 +#: ../../c-api/structures.rst:418 msgid "" "the offset in bytes that the member is located on the type's object struct" msgstr "" -#: ../../c-api/structures.rst:421 +#: ../../c-api/structures.rst:422 msgid ":attr:`flags`" msgstr ":attr:`flags`" -#: ../../c-api/structures.rst:421 +#: ../../c-api/structures.rst:422 msgid "flag bits indicating if the field should be read-only or writable" msgstr "" -#: ../../c-api/structures.rst:425 +#: ../../c-api/structures.rst:426 msgid ":attr:`doc`" msgstr ":attr:`doc`" -#: ../../c-api/structures.rst:429 +#: ../../c-api/structures.rst:430 msgid "" ":attr:`!type` can be one of many ``T_`` macros corresponding to various C " "types. When the member is accessed in Python, it will be converted to the " "equivalent Python type." msgstr "" -#: ../../c-api/structures.rst:434 +#: ../../c-api/structures.rst:435 msgid "Macro name" msgstr "" -#: ../../c-api/structures.rst:434 +#: ../../c-api/structures.rst:435 msgid "C type" msgstr "" -#: ../../c-api/structures.rst:436 +#: ../../c-api/structures.rst:437 msgid "T_SHORT" msgstr "T_SHORT" -#: ../../c-api/structures.rst:436 +#: ../../c-api/structures.rst:437 msgid "short" msgstr "" -#: ../../c-api/structures.rst:437 +#: ../../c-api/structures.rst:438 msgid "T_INT" msgstr "T_INT" -#: ../../c-api/structures.rst:438 +#: ../../c-api/structures.rst:439 msgid "T_LONG" msgstr "T_LONG" -#: ../../c-api/structures.rst:438 +#: ../../c-api/structures.rst:439 msgid "long" msgstr "long" -#: ../../c-api/structures.rst:439 +#: ../../c-api/structures.rst:440 msgid "T_FLOAT" msgstr "T_FLOAT" -#: ../../c-api/structures.rst:439 +#: ../../c-api/structures.rst:440 msgid "float" msgstr "float" -#: ../../c-api/structures.rst:440 +#: ../../c-api/structures.rst:441 msgid "T_DOUBLE" msgstr "T_DOUBLE" -#: ../../c-api/structures.rst:440 +#: ../../c-api/structures.rst:441 msgid "double" msgstr "double" -#: ../../c-api/structures.rst:441 +#: ../../c-api/structures.rst:442 msgid "T_STRING" msgstr "T_STRING" -#: ../../c-api/structures.rst:442 +#: ../../c-api/structures.rst:443 msgid "T_OBJECT" msgstr "T_OBJECT" -#: ../../c-api/structures.rst:442 ../../c-api/structures.rst:443 +#: ../../c-api/structures.rst:443 ../../c-api/structures.rst:444 msgid "PyObject \\*" msgstr "PyObject \\*" -#: ../../c-api/structures.rst:443 +#: ../../c-api/structures.rst:444 msgid "T_OBJECT_EX" msgstr "T_OBJECT_EX" -#: ../../c-api/structures.rst:444 +#: ../../c-api/structures.rst:445 msgid "T_CHAR" msgstr "T_CHAR" -#: ../../c-api/structures.rst:444 ../../c-api/structures.rst:445 -#: ../../c-api/structures.rst:450 +#: ../../c-api/structures.rst:445 ../../c-api/structures.rst:446 +#: ../../c-api/structures.rst:451 msgid "char" msgstr "char" -#: ../../c-api/structures.rst:445 +#: ../../c-api/structures.rst:446 msgid "T_BYTE" msgstr "T_BYTE" -#: ../../c-api/structures.rst:446 +#: ../../c-api/structures.rst:447 msgid "T_UBYTE" msgstr "T_UBYTE" -#: ../../c-api/structures.rst:446 +#: ../../c-api/structures.rst:447 msgid "unsigned char" msgstr "unsigned char" -#: ../../c-api/structures.rst:447 +#: ../../c-api/structures.rst:448 msgid "T_UINT" msgstr "T_UINT" -#: ../../c-api/structures.rst:447 +#: ../../c-api/structures.rst:448 msgid "unsigned int" msgstr "unsigned int" -#: ../../c-api/structures.rst:448 +#: ../../c-api/structures.rst:449 msgid "T_USHORT" msgstr "T_USHORT" -#: ../../c-api/structures.rst:448 +#: ../../c-api/structures.rst:449 msgid "unsigned short" msgstr "unsigned short" -#: ../../c-api/structures.rst:449 +#: ../../c-api/structures.rst:450 msgid "T_ULONG" msgstr "T_ULONG" -#: ../../c-api/structures.rst:449 +#: ../../c-api/structures.rst:450 msgid "unsigned long" msgstr "unsigned long" -#: ../../c-api/structures.rst:450 +#: ../../c-api/structures.rst:451 msgid "T_BOOL" msgstr "T_BOOL" -#: ../../c-api/structures.rst:451 +#: ../../c-api/structures.rst:452 msgid "T_LONGLONG" msgstr "T_LONGLONG" -#: ../../c-api/structures.rst:451 +#: ../../c-api/structures.rst:452 msgid "long long" msgstr "long long" -#: ../../c-api/structures.rst:452 +#: ../../c-api/structures.rst:453 msgid "T_ULONGLONG" msgstr "T_ULONGLONG" -#: ../../c-api/structures.rst:452 +#: ../../c-api/structures.rst:453 msgid "unsigned long long" msgstr "unsigned long long" -#: ../../c-api/structures.rst:453 +#: ../../c-api/structures.rst:454 msgid "T_PYSSIZET" msgstr "T_PYSSIZET" -#: ../../c-api/structures.rst:456 +#: ../../c-api/structures.rst:457 msgid "" ":c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` differ in that :c:macro:" "`T_OBJECT` returns ``None`` if the member is ``NULL`` and :c:macro:" @@ -640,7 +616,7 @@ msgid "" "than :c:macro:`T_OBJECT`." msgstr "" -#: ../../c-api/structures.rst:463 +#: ../../c-api/structures.rst:464 msgid "" ":attr:`flags` can be ``0`` for write and read access or :c:macro:`READONLY` " "for read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies :c:" @@ -649,7 +625,7 @@ msgid "" "are set to ``NULL``)." msgstr "" -#: ../../c-api/structures.rst:471 +#: ../../c-api/structures.rst:472 msgid "" "Heap allocated types (created using :c:func:`PyType_FromSpec` or similar), " "``PyMemberDef`` may contain definitions for the special members " @@ -660,100 +636,115 @@ msgid "" "``T_PYSSIZET`` and ``READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:488 +#: ../../c-api/structures.rst:489 msgid "" "Get an attribute belonging to the object at address *obj_addr*. The " "attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:495 +#: ../../c-api/structures.rst:496 msgid "" "Set an attribute belonging to the object at address *obj_addr* to object " "*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " "``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:502 +#: ../../c-api/structures.rst:503 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -#: ../../c-api/structures.rst:508 +#: ../../c-api/structures.rst:509 msgid "name" msgstr "" -#: ../../c-api/structures.rst:508 +#: ../../c-api/structures.rst:509 msgid "attribute name" msgstr "" -#: ../../c-api/structures.rst:510 +#: ../../c-api/structures.rst:511 msgid "get" msgstr "" -#: ../../c-api/structures.rst:510 +#: ../../c-api/structures.rst:511 msgid "getter" msgstr "" -#: ../../c-api/structures.rst:510 +#: ../../c-api/structures.rst:511 msgid "C function to get the attribute" msgstr "" -#: ../../c-api/structures.rst:512 +#: ../../c-api/structures.rst:513 msgid "set" msgstr "" -#: ../../c-api/structures.rst:512 +#: ../../c-api/structures.rst:513 msgid "setter" msgstr "" -#: ../../c-api/structures.rst:512 +#: ../../c-api/structures.rst:513 msgid "" "optional C function to set or delete the attribute, if omitted the attribute " "is readonly" msgstr "" -#: ../../c-api/structures.rst:516 +#: ../../c-api/structures.rst:517 msgid "doc" msgstr "" -#: ../../c-api/structures.rst:516 +#: ../../c-api/structures.rst:517 msgid "optional docstring" msgstr "" -#: ../../c-api/structures.rst:518 +#: ../../c-api/structures.rst:519 msgid "closure" msgstr "" -#: ../../c-api/structures.rst:518 +#: ../../c-api/structures.rst:519 msgid "void \\*" msgstr "void \\*" -#: ../../c-api/structures.rst:518 +#: ../../c-api/structures.rst:519 msgid "" "optional function pointer, providing additional data for getter and setter" msgstr "" -#: ../../c-api/structures.rst:523 +#: ../../c-api/structures.rst:524 msgid "" "The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " "and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:528 +#: ../../c-api/structures.rst:529 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" -#: ../../c-api/structures.rst:531 +#: ../../c-api/structures.rst:532 msgid "" "``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " "the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:536 +#: ../../c-api/structures.rst:537 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." msgstr "" + +#~ msgid ":attr:`ml_name`" +#~ msgstr ":attr:`ml_name`" + +#~ msgid ":attr:`ml_meth`" +#~ msgstr ":attr:`ml_meth`" + +#~ msgid "PyCFunction" +#~ msgstr "PyCFunction" + +#~ msgid ":attr:`ml_flags`" +#~ msgstr ":attr:`ml_flags`" + +#~ msgid ":attr:`ml_doc`" +#~ msgstr ":attr:`ml_doc`" diff --git a/library/zipfile.po b/library/zipfile.po index ac415ca9a37..67de71aaca6 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"POT-Creation-Date: 2022-12-18 00:16+0000\n" "PO-Revision-Date: 2018-05-23 16:16+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,7 +205,7 @@ msgid "" "accepted (see :class:`bz2 ` for more information)." msgstr "" -#: ../../library/zipfile.rst:181 ../../library/zipfile.rst:720 +#: ../../library/zipfile.rst:181 ../../library/zipfile.rst:721 msgid "" "The *strict_timestamps* argument, when set to ``False``, allows to zip files " "older than 1980-01-01 at the cost of setting the timestamp to 1980-01-01. " @@ -258,7 +258,7 @@ msgstr "" msgid "Added support for :mod:`bzip2 ` and :mod:`lzma` compression." msgstr "" -#: ../../library/zipfile.rst:221 ../../library/zipfile.rst:634 +#: ../../library/zipfile.rst:221 ../../library/zipfile.rst:635 msgid "ZIP64 extensions are enabled by default." msgstr "" @@ -282,7 +282,7 @@ msgstr "" msgid "Add the *compresslevel* parameter." msgstr "" -#: ../../library/zipfile.rst:238 ../../library/zipfile.rst:731 +#: ../../library/zipfile.rst:238 ../../library/zipfile.rst:732 msgid "The *strict_timestamps* keyword-only argument" msgstr "" @@ -321,16 +321,17 @@ msgid "" "Access a member of the archive as a binary file-like object. *name* can be " "either the name of a file within the archive or a :class:`ZipInfo` object. " "The *mode* parameter, if included, must be ``'r'`` (the default) or " -"``'w'``. *pwd* is the password used to decrypt encrypted ZIP files." +"``'w'``. *pwd* is the password used to decrypt encrypted ZIP files as a :" +"class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:278 +#: ../../library/zipfile.rst:279 msgid "" ":meth:`~ZipFile.open` is also a context manager and therefore supports the :" "keyword:`with` statement::" msgstr "" -#: ../../library/zipfile.rst:285 +#: ../../library/zipfile.rst:286 msgid "" "With *mode* ``'r'`` the file-like object (``ZipExtFile``) is read-only and " "provides the following methods: :meth:`~io.BufferedIOBase.read`, :meth:`~io." @@ -339,7 +340,7 @@ msgid "" "objects can operate independently of the ZipFile." msgstr "" -#: ../../library/zipfile.rst:292 +#: ../../library/zipfile.rst:293 msgid "" "With ``mode='w'``, a writable file handle is returned, which supports the :" "meth:`~io.BufferedIOBase.write` method. While a writable file handle is " @@ -347,7 +348,7 @@ msgid "" "exc:`ValueError`." msgstr "" -#: ../../library/zipfile.rst:297 +#: ../../library/zipfile.rst:298 msgid "" "When writing a file, if the file size is not known in advance but may exceed " "2 GiB, pass ``force_zip64=True`` to ensure that the header format is capable " @@ -356,45 +357,45 @@ msgid "" "as the *name* parameter." msgstr "" -#: ../../library/zipfile.rst:305 +#: ../../library/zipfile.rst:306 msgid "" "The :meth:`.open`, :meth:`read` and :meth:`extract` methods can take a " "filename or a :class:`ZipInfo` object. You will appreciate this when trying " "to read a ZIP file that contains members with duplicate names." msgstr "" -#: ../../library/zipfile.rst:309 +#: ../../library/zipfile.rst:310 msgid "" "Removed support of ``mode='U'``. Use :class:`io.TextIOWrapper` for reading " "compressed text files in :term:`universal newlines` mode." msgstr "" -#: ../../library/zipfile.rst:313 +#: ../../library/zipfile.rst:314 msgid "" ":meth:`ZipFile.open` can now be used to write files into the archive with " "the ``mode='w'`` option." msgstr "" -#: ../../library/zipfile.rst:317 +#: ../../library/zipfile.rst:318 msgid "" "Calling :meth:`.open` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:324 +#: ../../library/zipfile.rst:325 msgid "" "Extract a member from the archive to the current working directory; *member* " "must be its full name or a :class:`ZipInfo` object. Its file information is " "extracted as accurately as possible. *path* specifies a different directory " "to extract to. *member* can be a filename or a :class:`ZipInfo` object. " -"*pwd* is the password used for encrypted files." +"*pwd* is the password used for encrypted files as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:330 +#: ../../library/zipfile.rst:331 msgid "Returns the normalized path created (a directory or new file)." msgstr "" -#: ../../library/zipfile.rst:334 +#: ../../library/zipfile.rst:335 msgid "" "If a member filename is an absolute path, a drive/UNC sharepoint and leading " "(back)slashes will be stripped, e.g.: ``///foo/bar`` becomes ``foo/bar`` on " @@ -405,25 +406,25 @@ msgid "" "(``_``)." msgstr "" -#: ../../library/zipfile.rst:342 +#: ../../library/zipfile.rst:343 msgid "" "Calling :meth:`extract` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:346 ../../library/zipfile.rst:369 +#: ../../library/zipfile.rst:347 ../../library/zipfile.rst:370 msgid "The *path* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:352 +#: ../../library/zipfile.rst:353 msgid "" "Extract all members from the archive to the current working directory. " "*path* specifies a different directory to extract to. *members* is optional " "and must be a subset of the list returned by :meth:`namelist`. *pwd* is the " -"password used for encrypted files." +"password used for encrypted files as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:359 +#: ../../library/zipfile.rst:360 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of *path*, e.g. members that have " @@ -431,52 +432,54 @@ msgid "" "\"``. This module attempts to prevent that. See :meth:`extract` note." msgstr "" -#: ../../library/zipfile.rst:365 +#: ../../library/zipfile.rst:366 msgid "" "Calling :meth:`extractall` on a closed ZipFile will raise a :exc:" "`ValueError`. Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:375 +#: ../../library/zipfile.rst:376 msgid "Print a table of contents for the archive to ``sys.stdout``." msgstr "" -#: ../../library/zipfile.rst:380 -msgid "Set *pwd* as default password to extract encrypted files." +#: ../../library/zipfile.rst:381 +msgid "" +"Set *pwd* (a :class:`bytes` object) as default password to extract encrypted " +"files." msgstr "" -#: ../../library/zipfile.rst:385 +#: ../../library/zipfile.rst:386 msgid "" "Return the bytes of the file *name* in the archive. *name* is the name of " "the file in the archive, or a :class:`ZipInfo` object. The archive must be " -"open for read or append. *pwd* is the password used for encrypted files " -"and, if specified, it will override the default password set with :meth:" -"`setpassword`. Calling :meth:`read` on a ZipFile that uses a compression " -"method other than :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`, :const:" -"`ZIP_BZIP2` or :const:`ZIP_LZMA` will raise a :exc:`NotImplementedError`. An " -"error will also be raised if the corresponding compression module is not " -"available." +"open for read or append. *pwd* is the password used for encrypted files as " +"a :class:`bytes` object and, if specified, overrides the default password " +"set with :meth:`setpassword`. Calling :meth:`read` on a ZipFile that uses a " +"compression method other than :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`, :" +"const:`ZIP_BZIP2` or :const:`ZIP_LZMA` will raise a :exc:" +"`NotImplementedError`. An error will also be raised if the corresponding " +"compression module is not available." msgstr "" -#: ../../library/zipfile.rst:394 +#: ../../library/zipfile.rst:395 msgid "" "Calling :meth:`read` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:401 +#: ../../library/zipfile.rst:402 msgid "" "Read all the files in the archive and check their CRC's and file headers. " "Return the name of the first bad file, or else return ``None``." msgstr "" -#: ../../library/zipfile.rst:404 +#: ../../library/zipfile.rst:405 msgid "" "Calling :meth:`testzip` on a closed ZipFile will raise a :exc:`ValueError`. " "Previously, a :exc:`RuntimeError` was raised." msgstr "" -#: ../../library/zipfile.rst:412 +#: ../../library/zipfile.rst:413 msgid "" "Write the file named *filename* to the archive, giving it the archive name " "*arcname* (by default, this will be the same as *filename*, but without a " @@ -487,7 +490,7 @@ msgid "" "``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:422 +#: ../../library/zipfile.rst:423 msgid "" "The ZIP file standard historically did not specify a metadata encoding, but " "strongly recommended CP437 (the original IBM PC encoding) for " @@ -497,33 +500,33 @@ msgid "" "in any encoding other than ASCII or UTF-8." msgstr "" -#: ../../library/zipfile.rst:431 +#: ../../library/zipfile.rst:432 msgid "" "Archive names should be relative to the archive root, that is, they should " "not start with a path separator." msgstr "" -#: ../../library/zipfile.rst:436 +#: ../../library/zipfile.rst:437 msgid "" "If ``arcname`` (or ``filename``, if ``arcname`` is not given) contains a " "null byte, the name of the file in the archive will be truncated at the null " "byte." msgstr "" -#: ../../library/zipfile.rst:441 +#: ../../library/zipfile.rst:442 msgid "" "A leading slash in the filename may lead to the archive being impossible to " "open in some zip programs on Windows systems." msgstr "" -#: ../../library/zipfile.rst:444 +#: ../../library/zipfile.rst:445 msgid "" "Calling :meth:`write` on a ZipFile created with mode ``'r'`` or a closed " "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " "was raised." msgstr "" -#: ../../library/zipfile.rst:453 +#: ../../library/zipfile.rst:454 msgid "" "Write a file into the archive. The contents is *data*, which may be either " "a :class:`str` or a :class:`bytes` instance; if it is a :class:`str`, it is " @@ -534,7 +537,7 @@ msgid "" "must be opened with mode ``'w'``, ``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:461 +#: ../../library/zipfile.rst:462 msgid "" "If given, *compress_type* overrides the value given for the *compression* " "parameter to the constructor for the new entry, or in the *zinfo_or_arcname* " @@ -542,7 +545,7 @@ msgid "" "override the constructor if given." msgstr "" -#: ../../library/zipfile.rst:468 +#: ../../library/zipfile.rst:469 msgid "" "When passing a :class:`ZipInfo` instance as the *zinfo_or_arcname* " "parameter, the compression method used will be that specified in the " @@ -550,18 +553,18 @@ msgid "" "the :class:`ZipInfo` constructor sets this member to :const:`ZIP_STORED`." msgstr "" -#: ../../library/zipfile.rst:473 +#: ../../library/zipfile.rst:474 msgid "The *compress_type* argument." msgstr "*compress_type* 引數。" -#: ../../library/zipfile.rst:476 +#: ../../library/zipfile.rst:477 msgid "" "Calling :meth:`writestr` on a ZipFile created with mode ``'r'`` or a closed " "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " "was raised." msgstr "" -#: ../../library/zipfile.rst:483 +#: ../../library/zipfile.rst:484 msgid "" "Create a directory inside the archive. If *zinfo_or_directory* is a string, " "a directory is created inside the archive with the mode that is specified in " @@ -569,26 +572,26 @@ msgid "" "instance then the *mode* argument is ignored." msgstr "" -#: ../../library/zipfile.rst:488 +#: ../../library/zipfile.rst:489 msgid "The archive must be opened with mode ``'w'``, ``'x'`` or ``'a'``." msgstr "" -#: ../../library/zipfile.rst:493 +#: ../../library/zipfile.rst:494 msgid "The following data attributes are also available:" msgstr "" -#: ../../library/zipfile.rst:497 +#: ../../library/zipfile.rst:498 msgid "Name of the ZIP file." msgstr "" -#: ../../library/zipfile.rst:501 +#: ../../library/zipfile.rst:502 msgid "" "The level of debug output to use. This may be set from ``0`` (the default, " "no output) to ``3`` (the most output). Debugging information is written to " "``sys.stdout``." msgstr "" -#: ../../library/zipfile.rst:507 +#: ../../library/zipfile.rst:508 msgid "" "The comment associated with the ZIP file as a :class:`bytes` object. If " "assigning a comment to a :class:`ZipFile` instance created with mode " @@ -596,37 +599,37 @@ msgid "" "Comments longer than this will be truncated." msgstr "" -#: ../../library/zipfile.rst:517 +#: ../../library/zipfile.rst:518 msgid "Path Objects" msgstr "" -#: ../../library/zipfile.rst:521 +#: ../../library/zipfile.rst:522 msgid "" "Construct a Path object from a ``root`` zipfile (which may be a :class:" "`ZipFile` instance or ``file`` suitable for passing to the :class:`ZipFile` " "constructor)." msgstr "" -#: ../../library/zipfile.rst:525 +#: ../../library/zipfile.rst:526 msgid "" "``at`` specifies the location of this Path within the zipfile, e.g. 'dir/" "file.txt', 'dir/', or ''. Defaults to the empty string, indicating the root." msgstr "" -#: ../../library/zipfile.rst:529 +#: ../../library/zipfile.rst:530 msgid "" "Path objects expose the following features of :mod:`pathlib.Path` objects:" msgstr "" -#: ../../library/zipfile.rst:532 +#: ../../library/zipfile.rst:533 msgid "Path objects are traversable using the ``/`` operator or ``joinpath``." msgstr "" -#: ../../library/zipfile.rst:536 +#: ../../library/zipfile.rst:537 msgid "The final path component." msgstr "" -#: ../../library/zipfile.rst:540 +#: ../../library/zipfile.rst:541 msgid "" "Invoke :meth:`ZipFile.open` on the current path. Allows opening for read or " "write, text or binary through supported modes: 'r', 'w', 'rb', 'wb'. " @@ -635,122 +638,122 @@ msgid "" "``pwd`` parameter to :meth:`ZipFile.open`." msgstr "" -#: ../../library/zipfile.rst:549 +#: ../../library/zipfile.rst:550 msgid "" "Added support for text and binary modes for open. Default mode is now text." msgstr "" -#: ../../library/zipfile.rst:555 +#: ../../library/zipfile.rst:556 msgid "Enumerate the children of the current directory." msgstr "" -#: ../../library/zipfile.rst:559 +#: ../../library/zipfile.rst:560 msgid "Return ``True`` if the current context references a directory." msgstr "" -#: ../../library/zipfile.rst:563 +#: ../../library/zipfile.rst:564 msgid "Return ``True`` if the current context references a file." msgstr "" -#: ../../library/zipfile.rst:567 +#: ../../library/zipfile.rst:568 msgid "" "Return ``True`` if the current context references a file or directory in the " "zip file." msgstr "" -#: ../../library/zipfile.rst:572 +#: ../../library/zipfile.rst:573 msgid "The file extension of the final component." msgstr "" -#: ../../library/zipfile.rst:574 +#: ../../library/zipfile.rst:575 msgid "Added :data:`Path.suffix` property." msgstr "" -#: ../../library/zipfile.rst:579 +#: ../../library/zipfile.rst:580 msgid "The final path component, without its suffix." msgstr "" -#: ../../library/zipfile.rst:581 +#: ../../library/zipfile.rst:582 msgid "Added :data:`Path.stem` property." msgstr "" -#: ../../library/zipfile.rst:586 +#: ../../library/zipfile.rst:587 msgid "A list of the path’s file extensions." msgstr "" -#: ../../library/zipfile.rst:588 +#: ../../library/zipfile.rst:589 msgid "Added :data:`Path.suffixes` property." msgstr "" -#: ../../library/zipfile.rst:593 +#: ../../library/zipfile.rst:594 msgid "" "Read the current file as unicode text. Positional and keyword arguments are " "passed through to :class:`io.TextIOWrapper` (except ``buffer``, which is " "implied by the context)." msgstr "" -#: ../../library/zipfile.rst:600 +#: ../../library/zipfile.rst:601 msgid "Read the current file as bytes." msgstr "" -#: ../../library/zipfile.rst:604 +#: ../../library/zipfile.rst:605 msgid "" "Return a new Path object with each of the *other* arguments joined. The " "following are equivalent::" msgstr "" -#: ../../library/zipfile.rst:611 +#: ../../library/zipfile.rst:612 msgid "" "Prior to 3.10, ``joinpath`` was undocumented and accepted exactly one " "parameter." msgstr "" -#: ../../library/zipfile.rst:615 +#: ../../library/zipfile.rst:616 msgid "" "The `zipp `_ project provides backports of " "the latest path object functionality to older Pythons. Use ``zipp.Path`` in " "place of ``zipfile.Path`` for early access to changes." msgstr "" -#: ../../library/zipfile.rst:623 +#: ../../library/zipfile.rst:624 msgid "PyZipFile Objects" msgstr "PyZipFile 物件" -#: ../../library/zipfile.rst:625 +#: ../../library/zipfile.rst:626 msgid "" "The :class:`PyZipFile` constructor takes the same parameters as the :class:" "`ZipFile` constructor, and one additional parameter, *optimize*." msgstr "" -#: ../../library/zipfile.rst:631 +#: ../../library/zipfile.rst:632 msgid "The *optimize* parameter." msgstr "*optimize* 參數。" -#: ../../library/zipfile.rst:637 +#: ../../library/zipfile.rst:638 msgid "" "Instances have one method in addition to those of :class:`ZipFile` objects:" msgstr "" -#: ../../library/zipfile.rst:641 +#: ../../library/zipfile.rst:642 msgid "" "Search for files :file:`\\*.py` and add the corresponding file to the " "archive." msgstr "" -#: ../../library/zipfile.rst:644 +#: ../../library/zipfile.rst:645 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was not given or ``-1``, " "the corresponding file is a :file:`\\*.pyc` file, compiling if necessary." msgstr "" -#: ../../library/zipfile.rst:647 +#: ../../library/zipfile.rst:648 msgid "" "If the *optimize* parameter to :class:`PyZipFile` was ``0``, ``1`` or ``2``, " "only files with that optimization level (see :func:`compile`) are added to " "the archive, compiling if necessary." msgstr "" -#: ../../library/zipfile.rst:651 +#: ../../library/zipfile.rst:652 msgid "" "If *pathname* is a file, the filename must end with :file:`.py`, and just " "the (corresponding :file:`\\*.pyc`) file is added at the top level (no path " @@ -763,11 +766,11 @@ msgid "" "in sorted order." msgstr "" -#: ../../library/zipfile.rst:661 +#: ../../library/zipfile.rst:662 msgid "*basename* is intended for internal use only." msgstr "" -#: ../../library/zipfile.rst:663 +#: ../../library/zipfile.rst:664 msgid "" "*filterfunc*, if given, must be a function taking a single string argument. " "It will be passed each path (including each individual full file path) " @@ -778,286 +781,286 @@ msgid "" "exclude them::" msgstr "" -#: ../../library/zipfile.rst:677 +#: ../../library/zipfile.rst:678 msgid "The :meth:`writepy` method makes archives with file names like this::" msgstr "" -#: ../../library/zipfile.rst:686 +#: ../../library/zipfile.rst:687 msgid "The *filterfunc* parameter." msgstr "*filterfunc* 參數。" -#: ../../library/zipfile.rst:689 +#: ../../library/zipfile.rst:690 msgid "The *pathname* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:692 +#: ../../library/zipfile.rst:693 msgid "Recursion sorts directory entries." msgstr "" -#: ../../library/zipfile.rst:699 +#: ../../library/zipfile.rst:700 msgid "ZipInfo Objects" msgstr "ZipInfo 物件" -#: ../../library/zipfile.rst:701 +#: ../../library/zipfile.rst:702 msgid "" "Instances of the :class:`ZipInfo` class are returned by the :meth:`.getinfo` " "and :meth:`.infolist` methods of :class:`ZipFile` objects. Each object " "stores information about a single member of the ZIP archive." msgstr "" -#: ../../library/zipfile.rst:705 +#: ../../library/zipfile.rst:706 msgid "" "There is one classmethod to make a :class:`ZipInfo` instance for a " "filesystem file:" msgstr "" -#: ../../library/zipfile.rst:711 +#: ../../library/zipfile.rst:712 msgid "" "Construct a :class:`ZipInfo` instance for a file on the filesystem, in " "preparation for adding it to a zip file." msgstr "" -#: ../../library/zipfile.rst:714 +#: ../../library/zipfile.rst:715 msgid "*filename* should be the path to a file or directory on the filesystem." msgstr "" -#: ../../library/zipfile.rst:716 +#: ../../library/zipfile.rst:717 msgid "" "If *arcname* is specified, it is used as the name within the archive. If " "*arcname* is not specified, the name will be the same as *filename*, but " "with any drive letter and leading path separators removed." msgstr "" -#: ../../library/zipfile.rst:728 +#: ../../library/zipfile.rst:729 msgid "The *filename* parameter accepts a :term:`path-like object`." msgstr "" -#: ../../library/zipfile.rst:735 +#: ../../library/zipfile.rst:736 msgid "Instances have the following methods and attributes:" msgstr "" -#: ../../library/zipfile.rst:739 +#: ../../library/zipfile.rst:740 msgid "Return ``True`` if this archive member is a directory." msgstr "" -#: ../../library/zipfile.rst:741 +#: ../../library/zipfile.rst:742 msgid "This uses the entry's name: directories should always end with ``/``." msgstr "" -#: ../../library/zipfile.rst:748 +#: ../../library/zipfile.rst:749 msgid "Name of the file in the archive." msgstr "" -#: ../../library/zipfile.rst:753 +#: ../../library/zipfile.rst:754 msgid "" "The time and date of the last modification to the archive member. This is a " "tuple of six values:" msgstr "" -#: ../../library/zipfile.rst:757 +#: ../../library/zipfile.rst:758 msgid "Index" msgstr "" -#: ../../library/zipfile.rst:757 +#: ../../library/zipfile.rst:758 msgid "Value" msgstr "" -#: ../../library/zipfile.rst:759 +#: ../../library/zipfile.rst:760 msgid "``0``" msgstr "``0``" -#: ../../library/zipfile.rst:759 +#: ../../library/zipfile.rst:760 msgid "Year (>= 1980)" msgstr "" -#: ../../library/zipfile.rst:761 +#: ../../library/zipfile.rst:762 msgid "``1``" msgstr "``1``" -#: ../../library/zipfile.rst:761 +#: ../../library/zipfile.rst:762 msgid "Month (one-based)" msgstr "" -#: ../../library/zipfile.rst:763 +#: ../../library/zipfile.rst:764 msgid "``2``" msgstr "``2``" -#: ../../library/zipfile.rst:763 +#: ../../library/zipfile.rst:764 msgid "Day of month (one-based)" msgstr "" -#: ../../library/zipfile.rst:765 +#: ../../library/zipfile.rst:766 msgid "``3``" msgstr "``3``" -#: ../../library/zipfile.rst:765 +#: ../../library/zipfile.rst:766 msgid "Hours (zero-based)" msgstr "" -#: ../../library/zipfile.rst:767 +#: ../../library/zipfile.rst:768 msgid "``4``" msgstr "``4``" -#: ../../library/zipfile.rst:767 +#: ../../library/zipfile.rst:768 msgid "Minutes (zero-based)" msgstr "" -#: ../../library/zipfile.rst:769 +#: ../../library/zipfile.rst:770 msgid "``5``" msgstr "``5``" -#: ../../library/zipfile.rst:769 +#: ../../library/zipfile.rst:770 msgid "Seconds (zero-based)" msgstr "" -#: ../../library/zipfile.rst:774 +#: ../../library/zipfile.rst:775 msgid "The ZIP file format does not support timestamps before 1980." msgstr "" -#: ../../library/zipfile.rst:779 +#: ../../library/zipfile.rst:780 msgid "Type of compression for the archive member." msgstr "" -#: ../../library/zipfile.rst:784 +#: ../../library/zipfile.rst:785 msgid "Comment for the individual archive member as a :class:`bytes` object." msgstr "" -#: ../../library/zipfile.rst:789 +#: ../../library/zipfile.rst:790 msgid "" "Expansion field data. The `PKZIP Application Note`_ contains some comments " "on the internal structure of the data contained in this :class:`bytes` " "object." msgstr "" -#: ../../library/zipfile.rst:796 +#: ../../library/zipfile.rst:797 msgid "System which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:801 +#: ../../library/zipfile.rst:802 msgid "PKZIP version which created ZIP archive." msgstr "" -#: ../../library/zipfile.rst:806 +#: ../../library/zipfile.rst:807 msgid "PKZIP version needed to extract archive." msgstr "" -#: ../../library/zipfile.rst:811 +#: ../../library/zipfile.rst:812 msgid "Must be zero." msgstr "" -#: ../../library/zipfile.rst:816 +#: ../../library/zipfile.rst:817 msgid "ZIP flag bits." msgstr "" -#: ../../library/zipfile.rst:821 +#: ../../library/zipfile.rst:822 msgid "Volume number of file header." msgstr "" -#: ../../library/zipfile.rst:826 +#: ../../library/zipfile.rst:827 msgid "Internal attributes." msgstr "" -#: ../../library/zipfile.rst:831 +#: ../../library/zipfile.rst:832 msgid "External file attributes." msgstr "" -#: ../../library/zipfile.rst:836 +#: ../../library/zipfile.rst:837 msgid "Byte offset to the file header." msgstr "" -#: ../../library/zipfile.rst:841 +#: ../../library/zipfile.rst:842 msgid "CRC-32 of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:846 +#: ../../library/zipfile.rst:847 msgid "Size of the compressed data." msgstr "" -#: ../../library/zipfile.rst:851 +#: ../../library/zipfile.rst:852 msgid "Size of the uncompressed file." msgstr "" -#: ../../library/zipfile.rst:858 +#: ../../library/zipfile.rst:859 msgid "Command-Line Interface" msgstr "" -#: ../../library/zipfile.rst:860 +#: ../../library/zipfile.rst:861 msgid "" "The :mod:`zipfile` module provides a simple command-line interface to " "interact with ZIP archives." msgstr "" -#: ../../library/zipfile.rst:863 +#: ../../library/zipfile.rst:864 msgid "" "If you want to create a new ZIP archive, specify its name after the :option:" "`-c` option and then list the filename(s) that should be included:" msgstr "" -#: ../../library/zipfile.rst:870 +#: ../../library/zipfile.rst:871 msgid "Passing a directory is also acceptable:" msgstr "" -#: ../../library/zipfile.rst:876 +#: ../../library/zipfile.rst:877 msgid "" "If you want to extract a ZIP archive into the specified directory, use the :" "option:`-e` option:" msgstr "" -#: ../../library/zipfile.rst:883 +#: ../../library/zipfile.rst:884 msgid "For a list of the files in a ZIP archive, use the :option:`-l` option:" msgstr "" -#: ../../library/zipfile.rst:891 +#: ../../library/zipfile.rst:892 msgid "Command-line options" msgstr "" -#: ../../library/zipfile.rst:896 +#: ../../library/zipfile.rst:897 msgid "List files in a zipfile." msgstr "" -#: ../../library/zipfile.rst:901 +#: ../../library/zipfile.rst:902 msgid "Create zipfile from source files." msgstr "" -#: ../../library/zipfile.rst:906 +#: ../../library/zipfile.rst:907 msgid "Extract zipfile into target directory." msgstr "" -#: ../../library/zipfile.rst:911 +#: ../../library/zipfile.rst:912 msgid "Test whether the zipfile is valid or not." msgstr "" -#: ../../library/zipfile.rst:915 +#: ../../library/zipfile.rst:916 msgid "" "Specify encoding of member names for :option:`-l`, :option:`-e` and :option:" "`-t`." msgstr "" -#: ../../library/zipfile.rst:922 +#: ../../library/zipfile.rst:923 msgid "Decompression pitfalls" msgstr "" -#: ../../library/zipfile.rst:924 +#: ../../library/zipfile.rst:925 msgid "" "The extraction in zipfile module might fail due to some pitfalls listed " "below." msgstr "" -#: ../../library/zipfile.rst:927 +#: ../../library/zipfile.rst:928 msgid "From file itself" msgstr "" -#: ../../library/zipfile.rst:929 +#: ../../library/zipfile.rst:930 msgid "" "Decompression may fail due to incorrect password / CRC checksum / ZIP format " "or unsupported compression method / decryption." msgstr "" -#: ../../library/zipfile.rst:933 +#: ../../library/zipfile.rst:934 msgid "File System limitations" msgstr "" -#: ../../library/zipfile.rst:935 +#: ../../library/zipfile.rst:936 msgid "" "Exceeding limitations on different file systems can cause decompression " "failed. Such as allowable characters in the directory entries, length of the " @@ -1065,33 +1068,33 @@ msgid "" "files, etc." msgstr "" -#: ../../library/zipfile.rst:942 +#: ../../library/zipfile.rst:943 msgid "Resources limitations" msgstr "" -#: ../../library/zipfile.rst:944 +#: ../../library/zipfile.rst:945 msgid "" "The lack of memory or disk volume would lead to decompression failed. For " "example, decompression bombs (aka `ZIP bomb`_) apply to zipfile library that " "can cause disk volume exhaustion." msgstr "" -#: ../../library/zipfile.rst:949 +#: ../../library/zipfile.rst:950 msgid "Interruption" msgstr "" -#: ../../library/zipfile.rst:951 +#: ../../library/zipfile.rst:952 msgid "" "Interruption during the decompression, such as pressing control-C or killing " "the decompression process may result in incomplete decompression of the " "archive." msgstr "" -#: ../../library/zipfile.rst:955 +#: ../../library/zipfile.rst:956 msgid "Default behaviors of extraction" msgstr "" -#: ../../library/zipfile.rst:957 +#: ../../library/zipfile.rst:958 msgid "" "Not knowing the default extraction behaviors can cause unexpected " "decompression results. For example, when extracting the same archive twice, " From 54b74c958c5cccbec5993db175b539d06c4bd1f4 Mon Sep 17 00:00:00 2001 From: "Matt.Wang" Date: Mon, 19 Dec 2022 16:54:50 +0800 Subject: [PATCH 11/11] fix: resolve fuzzy entries --- c-api/structures.po | 15 --------------- library/asyncio-llapi-index.po | 3 +-- library/asyncio-stream.po | 3 +-- tutorial/classes.po | 16 +++++++--------- 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/c-api/structures.po b/c-api/structures.po index 2f5485846c2..cd571e57bcb 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -733,18 +733,3 @@ msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." msgstr "" - -#~ msgid ":attr:`ml_name`" -#~ msgstr ":attr:`ml_name`" - -#~ msgid ":attr:`ml_meth`" -#~ msgstr ":attr:`ml_meth`" - -#~ msgid "PyCFunction" -#~ msgstr "PyCFunction" - -#~ msgid ":attr:`ml_flags`" -#~ msgstr ":attr:`ml_flags`" - -#~ msgid ":attr:`ml_doc`" -#~ msgstr ":attr:`ml_doc`" diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 6a9b5681155..41796dce910 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -44,9 +44,8 @@ msgid ":func:`asyncio.get_event_loop`" msgstr ":func:`asyncio.get_event_loop`" #: ../../library/asyncio-llapi-index.rst:22 -#, fuzzy msgid "Get an event loop instance (running or current via the current policy)." -msgstr "獲得一個(當前的或透過 policy 建立的)事件迴圈實例。" +msgstr "獲得一個(正在運行的或透過當前 policy 建立的)事件迴圈實例。" #: ../../library/asyncio-llapi-index.rst:24 msgid ":func:`asyncio.set_event_loop`" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 91102c46dc5..80bf333e5ad 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -109,9 +109,8 @@ msgstr "移除 *loop* 參數。" #: ../../library/asyncio-stream.rst:86 ../../library/asyncio-stream.rst:128 #: ../../library/asyncio-stream.rst:160 ../../library/asyncio-stream.rst:190 -#, fuzzy msgid "Added the *ssl_shutdown_timeout* parameter." -msgstr "新增 *ssl_handshake_timeout* 參數。" +msgstr "新增 *ssl_shutdown_timeout* 參數。" #: ../../library/asyncio-stream.rst:98 msgid "Start a socket server." diff --git a/tutorial/classes.po b/tutorial/classes.po index 7d028f71ef4..7061e9bcf6a 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-12-13 00:16+0000\n" -"PO-Revision-Date: 2021-06-06 02:14+0800\n" +"PO-Revision-Date: 2022-12-19 16:52+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -19,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 2.4.3\n" +"X-Generator: Poedit 3.2.2\n" "X-Poedit-Bookmarks: 0,26,52,77,102,-1,-1,-1,-1,-1\n" #: ../../tutorial/classes.rst:5 @@ -250,7 +250,6 @@ msgid "the innermost scope, which is searched first, contains the local names" msgstr "最內層作用域,會最先被搜尋,而它包含了區域名稱" #: ../../tutorial/classes.rst:121 -#, fuzzy msgid "" "the scopes of any enclosing functions, which are searched starting with the " "nearest enclosing scope, contain non-local, but also non-global names" @@ -269,7 +268,6 @@ msgid "" msgstr "最外面的作用域(最後搜尋),是包含內建名稱的命名空間" #: ../../tutorial/classes.rst:126 -#, fuzzy msgid "" "If a name is declared global, then all references and assignments go " "directly to the next-to-last scope containing the module's global names. To " @@ -279,11 +277,11 @@ msgid "" "*new* local variable in the innermost scope, leaving the identically named " "outer variable unchanged)." msgstr "" -"如果一個名稱被宣告為全域,則所有的參照和賦值將直接轉到包含模組全域名稱的中間" -"作用域。要重新連結最內層作用域以外找到的變數,可以使用 :keyword:`nonlocal` 陳" -"述式;如果那些變數沒有被宣告為 nonlocal,則它們會是唯讀的(嘗試寫入這樣的變數" -"只會在最內層的作用域內建立一個\\ *新的*\\ 區域變數,同名的外部變數則維持不" -"變)。" +"如果一個名稱被宣告為全域,則所有的參照和賦值將直接轉到包含模組全域名稱的倒數" +"第二個作用域。要重新連結最內層作用域以外找到的變數,可以使用 :keyword:" +"`nonlocal` 陳述式;如果那些變數沒有被宣告為 nonlocal,則它們會是唯讀的(嘗試" +"寫入這樣的變數只會在最內層的作用域內建立一個\\ *新的*\\ 區域變數,同名的外部" +"變數則維持不變)。" #: ../../tutorial/classes.rst:133 msgid ""