diff --git a/library/importlib.po b/library/importlib.po index 2f7398079e..ae8037bd2d 100644 --- a/library/importlib.po +++ b/library/importlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 12:27+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:04+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -728,7 +728,7 @@ msgstr "" msgid "Use :meth:`Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:548 ../../library/importlib.rst:989 +#: ../../library/importlib.rst:548 ../../library/importlib.rst:1143 msgid "Returns :attr:`path`." msgstr "" @@ -855,58 +855,231 @@ msgid "" msgstr "" #: ../../library/importlib.rst:650 -msgid ":mod:`importlib.machinery` -- Importers and path hooks" +msgid "*Superseded by TraversableResources*" +msgstr "" + +#: ../../library/importlib.rst:652 +msgid "" +"An :term:`abstract base class` to provide the ability to read *resources*." msgstr "" #: ../../library/importlib.rst:655 +msgid "" +"From the perspective of this ABC, a *resource* is a binary artifact that is " +"shipped within a package. Typically this is something like a data file that " +"lives next to the ``__init__.py`` file of the package. The purpose of this " +"class is to help abstract out the accessing of such data files so that it " +"does not matter if the package and its data file(s) are stored in a e.g. zip " +"file versus on the file system." +msgstr "" + +#: ../../library/importlib.rst:663 +msgid "" +"For any of methods of this class, a *resource* argument is expected to be a :" +"term:`path-like object` which represents conceptually just a file name. This " +"means that no subdirectory paths should be included in the *resource* " +"argument. This is because the location of the package the reader is for, " +"acts as the \"directory\". Hence the metaphor for directories and file names " +"is packages and resources, respectively. This is also why instances of this " +"class are expected to directly correlate to a specific package (instead of " +"potentially representing multiple packages or a module)." +msgstr "" + +#: ../../library/importlib.rst:674 +msgid "" +"Loaders that wish to support resource reading are expected to provide a " +"method called ``get_resource_reader(fullname)`` which returns an object " +"implementing this ABC's interface. If the module specified by fullname is " +"not a package, this method should return :const:`None`. An object compatible " +"with this ABC should only be returned when the specified module is a package." +msgstr "" + +#: ../../library/importlib.rst:685 ../../library/importlib.rst:795 +msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." +msgstr "" + +#: ../../library/importlib.rst:688 +msgid "" +"Returns an opened, :term:`file-like object` for binary reading of the " +"*resource*." +msgstr "" + +#: ../../library/importlib.rst:691 +msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." +msgstr "" + +#: ../../library/importlib.rst:696 +msgid "Returns the file system path to the *resource*." +msgstr "" + +#: ../../library/importlib.rst:698 +msgid "" +"If the resource does not concretely exist on the file system, raise :exc:" +"`FileNotFoundError`." +msgstr "" + +#: ../../library/importlib.rst:703 +msgid "" +"Returns ``True`` if the named *name* is considered a resource. :exc:" +"`FileNotFoundError` is raised if *name* does not exist." +msgstr "" + +#: ../../library/importlib.rst:708 +msgid "" +"Returns an :term:`iterable` of strings over the contents of the package. Do " +"note that it is not required that all names returned by the iterator be " +"actual resources, e.g. it is acceptable to return names for which :meth:" +"`is_resource` would be false." +msgstr "" + +#: ../../library/importlib.rst:714 +msgid "" +"Allowing non-resource names to be returned is to allow for situations where " +"how a package and its resources are stored are known a priori and the non-" +"resource names would be useful. For instance, returning subdirectory names " +"is allowed so that when it is known that the package and resources are " +"stored on the file system then those subdirectory names can be used directly." +msgstr "" + +#: ../../library/importlib.rst:722 +msgid "The abstract method returns an iterable of no items." +msgstr "" + +#: ../../library/importlib.rst:727 +msgid "" +"An object with a subset of :class:`pathlib.Path` methods suitable for " +"traversing directories and opening files." +msgstr "" + +#: ../../library/importlib.rst:730 +msgid "" +"For a representation of the object on the file-system, use :meth:`importlib." +"resources.as_file`." +msgstr "" + +#: ../../library/importlib.rst:737 +msgid "Use :class:`importlib.resources.abc.Traversable` instead." +msgstr "" + +#: ../../library/importlib.rst:740 +msgid "Abstract. The base name of this object without any parent references." +msgstr "" + +#: ../../library/importlib.rst:744 +msgid "Yield ``Traversable`` objects in ``self``." +msgstr "" + +#: ../../library/importlib.rst:748 +msgid "Return ``True`` if ``self`` is a directory." +msgstr "" + +#: ../../library/importlib.rst:752 +msgid "Return ``True`` if ``self`` is a file." +msgstr "" + +#: ../../library/importlib.rst:756 +msgid "Return Traversable child in ``self``." +msgstr "" + +#: ../../library/importlib.rst:760 +msgid "Return ``Traversable`` child in ``self``." +msgstr "" + +#: ../../library/importlib.rst:764 +msgid "" +"*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " +"suitable for reading (same as :attr:`pathlib.Path.open`)." +msgstr "" + +#: ../../library/importlib.rst:767 +msgid "" +"When opening as text, accepts encoding parameters such as those accepted by :" +"attr:`io.TextIOWrapper`." +msgstr "" + +#: ../../library/importlib.rst:772 +msgid "Read contents of ``self`` as bytes." +msgstr "" + +#: ../../library/importlib.rst:776 +msgid "Read contents of ``self`` as text." +msgstr "" + +#: ../../library/importlib.rst:781 +msgid "" +"An abstract base class for resource readers capable of serving the :meth:" +"`importlib.resources.files` interface. Subclasses :class:`importlib." +"resources.abc.ResourceReader` and provides concrete implementations of the :" +"class:`importlib.resources.abc.ResourceReader`'s abstract methods. " +"Therefore, any loader supplying :class:`importlib.abc.TraversableResources` " +"also supplies ResourceReader." +msgstr "" + +#: ../../library/importlib.rst:788 +msgid "" +"Loaders that wish to support resource reading are expected to implement this " +"interface." +msgstr "" + +#: ../../library/importlib.rst:798 +msgid "" +"Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " +"package." +msgstr "" + +#: ../../library/importlib.rst:804 +msgid ":mod:`importlib.machinery` -- Importers and path hooks" +msgstr "" + +#: ../../library/importlib.rst:809 msgid "**Source code:** :source:`Lib/importlib/machinery.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/machinery.py`" -#: ../../library/importlib.rst:659 +#: ../../library/importlib.rst:813 msgid "" "This module contains the various objects that help :keyword:`import` find " "and load modules." msgstr "" -#: ../../library/importlib.rst:664 +#: ../../library/importlib.rst:818 msgid "" "A list of strings representing the recognized file suffixes for source " "modules." msgstr "" -#: ../../library/importlib.rst:671 +#: ../../library/importlib.rst:825 msgid "" "A list of strings representing the file suffixes for non-optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:676 ../../library/importlib.rst:686 +#: ../../library/importlib.rst:830 ../../library/importlib.rst:840 msgid "Use :attr:`BYTECODE_SUFFIXES` instead." msgstr "" -#: ../../library/importlib.rst:681 +#: ../../library/importlib.rst:835 msgid "" "A list of strings representing the file suffixes for optimized bytecode " "modules." msgstr "" -#: ../../library/importlib.rst:691 +#: ../../library/importlib.rst:845 msgid "" "A list of strings representing the recognized file suffixes for bytecode " "modules (including the leading dot)." msgstr "" -#: ../../library/importlib.rst:696 +#: ../../library/importlib.rst:850 msgid "The value is no longer dependent on ``__debug__``." msgstr "" -#: ../../library/importlib.rst:701 +#: ../../library/importlib.rst:855 msgid "" "A list of strings representing the recognized file suffixes for extension " "modules." msgstr "" -#: ../../library/importlib.rst:708 +#: ../../library/importlib.rst:862 msgid "" "Returns a combined list of strings representing all file suffixes for " "modules recognized by the standard import machinery. This is a helper for " @@ -915,57 +1088,57 @@ msgid "" "`inspect.getmodulename`)." msgstr "" -#: ../../library/importlib.rst:719 +#: ../../library/importlib.rst:873 msgid "" "An :term:`importer` for built-in modules. All known built-in modules are " "listed in :data:`sys.builtin_module_names`. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:724 ../../library/importlib.rst:738 -#: ../../library/importlib.rst:751 ../../library/importlib.rst:766 +#: ../../library/importlib.rst:878 ../../library/importlib.rst:892 +#: ../../library/importlib.rst:905 ../../library/importlib.rst:920 msgid "" "Only class methods are defined by this class to alleviate the need for " "instantiation." msgstr "" -#: ../../library/importlib.rst:727 +#: ../../library/importlib.rst:881 msgid "" "As part of :pep:`489`, the builtin importer now implements :meth:`Loader." "create_module` and :meth:`Loader.exec_module`" msgstr "" -#: ../../library/importlib.rst:734 +#: ../../library/importlib.rst:888 msgid "" "An :term:`importer` for frozen modules. This class implements the :class:" "`importlib.abc.MetaPathFinder` and :class:`importlib.abc.InspectLoader` ABCs." msgstr "" -#: ../../library/importlib.rst:741 +#: ../../library/importlib.rst:895 msgid "" "Gained :meth:`~Loader.create_module` and :meth:`~Loader.exec_module` methods." msgstr "" -#: ../../library/importlib.rst:748 +#: ../../library/importlib.rst:902 msgid "" ":term:`Finder ` for modules declared in the Windows registry. This " "class implements the :class:`importlib.abc.MetaPathFinder` ABC." msgstr "" -#: ../../library/importlib.rst:756 +#: ../../library/importlib.rst:910 msgid "" "Use :mod:`site` configuration instead. Future versions of Python may not " "enable this finder by default." msgstr "" -#: ../../library/importlib.rst:763 +#: ../../library/importlib.rst:917 msgid "" "A :term:`Finder ` for :data:`sys.path` and package ``__path__`` " "attributes. This class implements the :class:`importlib.abc.MetaPathFinder` " "ABC." msgstr "" -#: ../../library/importlib.rst:771 +#: ../../library/importlib.rst:925 msgid "" "Class method that attempts to find a :term:`spec ` for the " "module specified by *fullname* on :data:`sys.path` or, if defined, on " @@ -979,43 +1152,43 @@ msgid "" "cache and returned." msgstr "" -#: ../../library/importlib.rst:785 +#: ../../library/importlib.rst:939 msgid "" "If the current working directory -- represented by an empty string -- is no " "longer valid then ``None`` is returned but no value is cached in :data:`sys." "path_importer_cache`." msgstr "" -#: ../../library/importlib.rst:792 +#: ../../library/importlib.rst:946 msgid "" "Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all finders " "stored in :data:`sys.path_importer_cache` that define the method. Otherwise " "entries in :data:`sys.path_importer_cache` set to ``None`` are deleted." msgstr "" -#: ../../library/importlib.rst:797 +#: ../../library/importlib.rst:951 msgid "Entries of ``None`` in :data:`sys.path_importer_cache` are deleted." msgstr "" -#: ../../library/importlib.rst:800 +#: ../../library/importlib.rst:954 msgid "" "Calls objects in :data:`sys.path_hooks` with the current working directory " "for ``''`` (i.e. the empty string)." msgstr "" -#: ../../library/importlib.rst:807 +#: ../../library/importlib.rst:961 msgid "" "A concrete implementation of :class:`importlib.abc.PathEntryFinder` which " "caches results from the file system." msgstr "" -#: ../../library/importlib.rst:810 +#: ../../library/importlib.rst:964 msgid "" "The *path* argument is the directory for which the finder is in charge of " "searching." msgstr "" -#: ../../library/importlib.rst:813 +#: ../../library/importlib.rst:967 msgid "" "The *loader_details* argument is a variable number of 2-item tuples each " "containing a loader and a sequence of file suffixes the loader recognizes. " @@ -1023,7 +1196,7 @@ msgid "" "module's name and the path to the file found." msgstr "" -#: ../../library/importlib.rst:818 +#: ../../library/importlib.rst:972 msgid "" "The finder will cache the directory contents as necessary, making stat calls " "for each module search to verify the cache is not outdated. Because cache " @@ -1036,166 +1209,166 @@ msgid "" "to call :func:`importlib.invalidate_caches`." msgstr "" -#: ../../library/importlib.rst:832 +#: ../../library/importlib.rst:986 msgid "The path the finder will search in." msgstr "" -#: ../../library/importlib.rst:836 +#: ../../library/importlib.rst:990 msgid "Attempt to find the spec to handle *fullname* within :attr:`path`." msgstr "" -#: ../../library/importlib.rst:842 +#: ../../library/importlib.rst:996 msgid "Clear out the internal cache." msgstr "" -#: ../../library/importlib.rst:846 +#: ../../library/importlib.rst:1000 msgid "" "A class method which returns a closure for use on :data:`sys.path_hooks`. An " "instance of :class:`FileFinder` is returned by the closure using the path " "argument given to the closure directly and *loader_details* indirectly." msgstr "" -#: ../../library/importlib.rst:851 +#: ../../library/importlib.rst:1005 msgid "" "If the argument to the closure is not an existing directory, :exc:" "`ImportError` is raised." msgstr "" -#: ../../library/importlib.rst:857 +#: ../../library/importlib.rst:1011 msgid "" "A concrete implementation of :class:`importlib.abc.SourceLoader` by " "subclassing :class:`importlib.abc.FileLoader` and providing some concrete " "implementations of other methods." msgstr "" -#: ../../library/importlib.rst:865 +#: ../../library/importlib.rst:1019 msgid "The name of the module that this loader will handle." msgstr "" -#: ../../library/importlib.rst:869 +#: ../../library/importlib.rst:1023 msgid "The path to the source file." msgstr "" -#: ../../library/importlib.rst:873 +#: ../../library/importlib.rst:1027 msgid "Return ``True`` if :attr:`path` appears to be for a package." msgstr "" -#: ../../library/importlib.rst:877 +#: ../../library/importlib.rst:1031 msgid "" "Concrete implementation of :meth:`importlib.abc.SourceLoader.path_stats`." msgstr "" -#: ../../library/importlib.rst:881 +#: ../../library/importlib.rst:1035 msgid "Concrete implementation of :meth:`importlib.abc.SourceLoader.set_data`." msgstr "" -#: ../../library/importlib.rst:885 ../../library/importlib.rst:928 +#: ../../library/importlib.rst:1039 ../../library/importlib.rst:1082 msgid "" "Concrete implementation of :meth:`importlib.abc.Loader.load_module` where " "specifying the name of the module to load is optional." msgstr "" -#: ../../library/importlib.rst:890 ../../library/importlib.rst:933 +#: ../../library/importlib.rst:1044 ../../library/importlib.rst:1087 msgid "Use :meth:`importlib.abc.Loader.exec_module` instead." msgstr "" -#: ../../library/importlib.rst:895 +#: ../../library/importlib.rst:1049 msgid "" "A concrete implementation of :class:`importlib.abc.FileLoader` which can " "import bytecode files (i.e. no source code files exist)." msgstr "" -#: ../../library/importlib.rst:898 +#: ../../library/importlib.rst:1052 msgid "" "Please note that direct use of bytecode files (and thus not source code " "files) inhibits your modules from being usable by all Python implementations " "or new versions of Python which change the bytecode format." msgstr "" -#: ../../library/importlib.rst:907 +#: ../../library/importlib.rst:1061 msgid "The name of the module the loader will handle." msgstr "" -#: ../../library/importlib.rst:911 +#: ../../library/importlib.rst:1065 msgid "The path to the bytecode file." msgstr "" -#: ../../library/importlib.rst:915 +#: ../../library/importlib.rst:1069 msgid "Determines if the module is a package based on :attr:`path`." msgstr "" -#: ../../library/importlib.rst:919 +#: ../../library/importlib.rst:1073 msgid "Returns the code object for :attr:`name` created from :attr:`path`." msgstr "" -#: ../../library/importlib.rst:923 +#: ../../library/importlib.rst:1077 msgid "" "Returns ``None`` as bytecode files have no source when this loader is used." msgstr "" -#: ../../library/importlib.rst:938 +#: ../../library/importlib.rst:1092 msgid "" "A concrete implementation of :class:`importlib.abc.ExecutionLoader` for " "extension modules." msgstr "" -#: ../../library/importlib.rst:941 +#: ../../library/importlib.rst:1095 msgid "" "The *fullname* argument specifies the name of the module the loader is to " "support. The *path* argument is the path to the extension module's file." msgstr "" -#: ../../library/importlib.rst:944 +#: ../../library/importlib.rst:1098 msgid "" "Note that, by default, importing an extension module will fail in " "subinterpreters if it doesn't implement multi-phase init (see :pep:`489`), " "even if it would otherwise import successfully." msgstr "" -#: ../../library/importlib.rst:950 +#: ../../library/importlib.rst:1104 msgid "Multi-phase init is now required for use in subinterpreters." msgstr "" -#: ../../library/importlib.rst:955 +#: ../../library/importlib.rst:1109 msgid "Name of the module the loader supports." msgstr "" -#: ../../library/importlib.rst:959 +#: ../../library/importlib.rst:1113 msgid "Path to the extension module." msgstr "" -#: ../../library/importlib.rst:963 +#: ../../library/importlib.rst:1117 msgid "" "Creates the module object from the given specification in accordance with :" "pep:`489`." msgstr "" -#: ../../library/importlib.rst:970 +#: ../../library/importlib.rst:1124 msgid "Initializes the given module object in accordance with :pep:`489`." msgstr "" -#: ../../library/importlib.rst:976 +#: ../../library/importlib.rst:1130 msgid "" "Returns ``True`` if the file path points to a package's ``__init__`` module " "based on :attr:`EXTENSION_SUFFIXES`." msgstr "" -#: ../../library/importlib.rst:981 +#: ../../library/importlib.rst:1135 msgid "Returns ``None`` as extension modules lack a code object." msgstr "" -#: ../../library/importlib.rst:985 +#: ../../library/importlib.rst:1139 msgid "Returns ``None`` as extension modules do not have source code." msgstr "" -#: ../../library/importlib.rst:996 +#: ../../library/importlib.rst:1150 msgid "" "A concrete implementation of :class:`importlib.abc.InspectLoader` for " "namespace packages. This is an alias for a private class and is only made " "public for introspecting the ``__loader__`` attribute on namespace packages::" msgstr "" -#: ../../library/importlib.rst:1014 +#: ../../library/importlib.rst:1168 msgid "" "A specification for a module's import-system-related state. This is " "typically exposed as the module's :attr:`__spec__` attribute. In the " @@ -1208,31 +1381,31 @@ msgid "" "reflected in the module's :attr:`__spec__.origin`, and vice versa." msgstr "" -#: ../../library/importlib.rst:1028 +#: ../../library/importlib.rst:1182 msgid "(:attr:`__name__`)" msgstr "(:attr:`__name__`)" -#: ../../library/importlib.rst:1030 +#: ../../library/importlib.rst:1184 msgid "" "The module's fully qualified name. The :term:`finder` should always set this " "attribute to a non-empty string." msgstr "" -#: ../../library/importlib.rst:1035 +#: ../../library/importlib.rst:1189 msgid "(:attr:`__loader__`)" msgstr "(:attr:`__loader__`)" -#: ../../library/importlib.rst:1037 +#: ../../library/importlib.rst:1191 msgid "" "The :term:`loader` used to load the module. The :term:`finder` should always " "set this attribute." msgstr "" -#: ../../library/importlib.rst:1042 +#: ../../library/importlib.rst:1196 msgid "(:attr:`__file__`)" msgstr "(:attr:`__file__`)" -#: ../../library/importlib.rst:1044 +#: ../../library/importlib.rst:1198 msgid "" "The location the :term:`loader` should use to load the module. For example, " "for modules loaded from a .py file this is the filename. The :term:`finder` " @@ -1241,11 +1414,11 @@ msgid "" "namespace packages), it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1052 +#: ../../library/importlib.rst:1206 msgid "(:attr:`__path__`)" msgstr "(:attr:`__path__`)" -#: ../../library/importlib.rst:1054 +#: ../../library/importlib.rst:1208 msgid "" "The list of locations where the package's submodules will be found. Most of " "the time this is a single directory. The :term:`finder` should set this " @@ -1255,66 +1428,66 @@ msgid "" "packages." msgstr "" -#: ../../library/importlib.rst:1063 +#: ../../library/importlib.rst:1217 msgid "" "The :term:`finder` may set this attribute to an object containing " "additional, module-specific data to use when loading the module. Otherwise " "it should be set to ``None``." msgstr "" -#: ../../library/importlib.rst:1069 +#: ../../library/importlib.rst:1223 msgid "(:attr:`__cached__`)" msgstr "(:attr:`__cached__`)" -#: ../../library/importlib.rst:1071 +#: ../../library/importlib.rst:1225 msgid "" "The filename of a compiled version of the module's code. The :term:`finder` " "should always set this attribute but it may be ``None`` for modules that do " "not need compiled code stored." msgstr "" -#: ../../library/importlib.rst:1077 +#: ../../library/importlib.rst:1231 msgid "(:attr:`__package__`)" msgstr "(:attr:`__package__`)" -#: ../../library/importlib.rst:1079 +#: ../../library/importlib.rst:1233 msgid "" "(Read-only) The fully qualified name of the package the module is in (or the " "empty string for a top-level module). If the module is a package then this " "is the same as :attr:`name`." msgstr "" -#: ../../library/importlib.rst:1086 +#: ../../library/importlib.rst:1240 msgid "``True`` if the spec's :attr:`origin` refers to a loadable location," msgstr "" -#: ../../library/importlib.rst:1086 +#: ../../library/importlib.rst:1240 msgid "" "``False`` otherwise. This value impacts how :attr:`origin` is interpreted " "and how the module's :attr:`__file__` is populated." msgstr "" -#: ../../library/importlib.rst:1091 +#: ../../library/importlib.rst:1245 msgid ":mod:`importlib.util` -- Utility code for importers" msgstr "" -#: ../../library/importlib.rst:1097 +#: ../../library/importlib.rst:1251 msgid "**Source code:** :source:`Lib/importlib/util.py`" msgstr "**原始碼:**\\ :source:`Lib/importlib/util.py`" -#: ../../library/importlib.rst:1101 +#: ../../library/importlib.rst:1255 msgid "" "This module contains the various objects that help in the construction of " "an :term:`importer`." msgstr "" -#: ../../library/importlib.rst:1106 +#: ../../library/importlib.rst:1260 msgid "" "The bytes which represent the bytecode version number. If you need help with " "loading/writing bytecode then consider :class:`importlib.abc.SourceLoader`." msgstr "" -#: ../../library/importlib.rst:1113 +#: ../../library/importlib.rst:1267 msgid "" "Return the :pep:`3147`/:pep:`488` path to the byte-compiled file associated " "with the source *path*. For example, if *path* is ``/foo/bar/baz.py`` the " @@ -1324,7 +1497,7 @@ msgid "" "`NotImplementedError` will be raised)." msgstr "" -#: ../../library/importlib.rst:1120 +#: ../../library/importlib.rst:1274 msgid "" "The *optimization* parameter is used to specify the optimization level of " "the bytecode file. An empty string represents no optimization, so ``/foo/bar/" @@ -1337,7 +1510,7 @@ msgid "" "be alphanumeric, else :exc:`ValueError` is raised." msgstr "" -#: ../../library/importlib.rst:1130 +#: ../../library/importlib.rst:1284 msgid "" "The *debug_override* parameter is deprecated and can be used to override the " "system's value for ``__debug__``. A ``True`` value is the equivalent of " @@ -1346,18 +1519,18 @@ msgid "" "are not ``None`` then :exc:`TypeError` is raised." msgstr "" -#: ../../library/importlib.rst:1138 +#: ../../library/importlib.rst:1292 msgid "" "The *optimization* parameter was added and the *debug_override* parameter " "was deprecated." msgstr "" -#: ../../library/importlib.rst:1142 ../../library/importlib.rst:1158 -#: ../../library/importlib.rst:1247 +#: ../../library/importlib.rst:1296 ../../library/importlib.rst:1312 +#: ../../library/importlib.rst:1401 msgid "Accepts a :term:`path-like object`." msgstr "" -#: ../../library/importlib.rst:1148 +#: ../../library/importlib.rst:1302 msgid "" "Given the *path* to a :pep:`3147` file name, return the associated source " "code file path. For example, if *path* is ``/foo/bar/__pycache__/baz." @@ -1367,25 +1540,25 @@ msgid "" "cache_tag` is not defined, :exc:`NotImplementedError` is raised." msgstr "" -#: ../../library/importlib.rst:1163 +#: ../../library/importlib.rst:1317 msgid "" "Decode the given bytes representing source code and return it as a string " "with universal newlines (as required by :meth:`importlib.abc.InspectLoader." "get_source`)." msgstr "" -#: ../../library/importlib.rst:1171 +#: ../../library/importlib.rst:1325 msgid "Resolve a relative module name to an absolute one." msgstr "" -#: ../../library/importlib.rst:1173 +#: ../../library/importlib.rst:1327 msgid "" "If **name** has no leading dots, then **name** is simply returned. This " "allows for usage such as ``importlib.util.resolve_name('sys', __spec__." "parent)`` without doing a check to see if the **package** argument is needed." msgstr "" -#: ../../library/importlib.rst:1178 +#: ../../library/importlib.rst:1332 msgid "" ":exc:`ImportError` is raised if **name** is a relative module name but " "**package** is a false value (e.g. ``None`` or the empty string). :exc:" @@ -1393,13 +1566,13 @@ msgid "" "package (e.g. requesting ``..bacon`` from within the ``spam`` package)." msgstr "" -#: ../../library/importlib.rst:1186 +#: ../../library/importlib.rst:1340 msgid "" "To improve consistency with import statements, raise :exc:`ImportError` " "instead of :exc:`ValueError` for invalid relative import attempts." msgstr "" -#: ../../library/importlib.rst:1193 +#: ../../library/importlib.rst:1347 msgid "" "Find the :term:`spec ` for a module, optionally relative to the " "specified **package** name. If the module is in :data:`sys.modules`, then " @@ -1409,30 +1582,30 @@ msgid "" "if no spec is found." msgstr "" -#: ../../library/importlib.rst:1200 +#: ../../library/importlib.rst:1354 msgid "" "If **name** is for a submodule (contains a dot), the parent module is " "automatically imported." msgstr "" -#: ../../library/importlib.rst:1203 +#: ../../library/importlib.rst:1357 msgid "**name** and **package** work the same as for :func:`import_module`." msgstr "" -#: ../../library/importlib.rst:1207 +#: ../../library/importlib.rst:1361 msgid "" "Raises :exc:`ModuleNotFoundError` instead of :exc:`AttributeError` if " "**package** is in fact not a package (i.e. lacks a :attr:`__path__` " "attribute)." msgstr "" -#: ../../library/importlib.rst:1214 +#: ../../library/importlib.rst:1368 msgid "" "Create a new module based on **spec** and :meth:`spec.loader.create_module " "`." msgstr "" -#: ../../library/importlib.rst:1217 +#: ../../library/importlib.rst:1371 msgid "" "If :meth:`spec.loader.create_module ` " "does not return ``None``, then any pre-existing attributes will not be " @@ -1440,14 +1613,14 @@ msgid "" "accessing **spec** or setting an attribute on the module." msgstr "" -#: ../../library/importlib.rst:1222 +#: ../../library/importlib.rst:1376 msgid "" "This function is preferred over using :class:`types.ModuleType` to create a " "new module as **spec** is used to set as many import-controlled attributes " "on the module as possible." msgstr "" -#: ../../library/importlib.rst:1230 +#: ../../library/importlib.rst:1384 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on a loader. The parameters have the same meaning as they do " @@ -1456,7 +1629,7 @@ msgid "" "spec." msgstr "" -#: ../../library/importlib.rst:1240 +#: ../../library/importlib.rst:1394 msgid "" "A factory function for creating a :class:`~importlib.machinery.ModuleSpec` " "instance based on the path to a file. Missing information will be filled in " @@ -1464,14 +1637,14 @@ msgid "" "module will be file-based." msgstr "" -#: ../../library/importlib.rst:1252 +#: ../../library/importlib.rst:1406 msgid "" "Return the hash of *source_bytes* as bytes. A hash-based ``.pyc`` file " "embeds the :func:`source_hash` of the corresponding source file's contents " "in its header." msgstr "" -#: ../../library/importlib.rst:1260 +#: ../../library/importlib.rst:1414 msgid "" "A context manager that can temporarily skip the compatibility check for " "extension modules. By default the check is enabled and will fail when a " @@ -1480,33 +1653,33 @@ msgid "" "interpreter GIL, when imported in an interpreter with its own GIL." msgstr "" -#: ../../library/importlib.rst:1267 +#: ../../library/importlib.rst:1421 msgid "" "Note that this function is meant to accommodate an unusual case; one which " "is likely to eventually go away. There's is a pretty good chance this is " "not what you were looking for." msgstr "" -#: ../../library/importlib.rst:1271 +#: ../../library/importlib.rst:1425 msgid "" "You can get the same effect as this function by implementing the basic " "interface of multi-phase init (:pep:`489`) and lying about support for " "multiple interpreters (or per-interpreter GIL)." msgstr "" -#: ../../library/importlib.rst:1276 +#: ../../library/importlib.rst:1430 msgid "" "Using this function to disable the check can lead to unexpected behavior and " "even crashes. It should only be used during extension module development." msgstr "" -#: ../../library/importlib.rst:1284 +#: ../../library/importlib.rst:1438 msgid "" "A class which postpones the execution of the loader of a module until the " "module has an attribute accessed." msgstr "" -#: ../../library/importlib.rst:1287 +#: ../../library/importlib.rst:1441 msgid "" "This class **only** works with loaders that define :meth:`~importlib.abc." "Loader.exec_module` as control over what module type is used for the module " @@ -1519,7 +1692,7 @@ msgid "" "raised if such a substitution is detected." msgstr "" -#: ../../library/importlib.rst:1298 +#: ../../library/importlib.rst:1452 msgid "" "For projects where startup time is critical, this class allows for " "potentially minimizing the cost of loading a module if it is never used. For " @@ -1528,70 +1701,70 @@ msgid "" "postponed and thus occurring out of context." msgstr "" -#: ../../library/importlib.rst:1306 +#: ../../library/importlib.rst:1460 msgid "" "Began calling :meth:`~importlib.abc.Loader.create_module`, removing the " "compatibility warning for :class:`importlib.machinery.BuiltinImporter` and :" "class:`importlib.machinery.ExtensionFileLoader`." msgstr "" -#: ../../library/importlib.rst:1313 +#: ../../library/importlib.rst:1467 msgid "" "A class method which returns a callable that creates a lazy loader. This is " "meant to be used in situations where the loader is passed by class instead " "of by instance. ::" msgstr "" -#: ../../library/importlib.rst:1326 +#: ../../library/importlib.rst:1480 msgid "Examples" msgstr "範例" -#: ../../library/importlib.rst:1329 +#: ../../library/importlib.rst:1483 msgid "Importing programmatically" msgstr "" -#: ../../library/importlib.rst:1331 +#: ../../library/importlib.rst:1485 msgid "" "To programmatically import a module, use :func:`importlib.import_module`. ::" msgstr "" -#: ../../library/importlib.rst:1340 +#: ../../library/importlib.rst:1494 msgid "Checking if a module can be imported" msgstr "" -#: ../../library/importlib.rst:1342 +#: ../../library/importlib.rst:1496 msgid "" "If you need to find out if a module can be imported without actually doing " "the import, then you should use :func:`importlib.util.find_spec`." msgstr "" -#: ../../library/importlib.rst:1345 +#: ../../library/importlib.rst:1499 msgid "" "Note that if ``name`` is a submodule (contains a dot), :func:`importlib.util." "find_spec` will import the parent module. ::" msgstr "" -#: ../../library/importlib.rst:1368 +#: ../../library/importlib.rst:1522 msgid "Importing a source file directly" msgstr "" -#: ../../library/importlib.rst:1370 +#: ../../library/importlib.rst:1524 msgid "To import a Python source file directly, use the following recipe::" msgstr "" -#: ../../library/importlib.rst:1387 +#: ../../library/importlib.rst:1541 msgid "Implementing lazy imports" msgstr "" -#: ../../library/importlib.rst:1389 +#: ../../library/importlib.rst:1543 msgid "The example below shows how to implement lazy imports::" msgstr "" -#: ../../library/importlib.rst:1411 +#: ../../library/importlib.rst:1565 msgid "Setting up an importer" msgstr "" -#: ../../library/importlib.rst:1413 +#: ../../library/importlib.rst:1567 msgid "" "For deep customizations of import, you typically want to implement an :term:" "`importer`. This means managing both the :term:`finder` and :term:`loader` " @@ -1605,11 +1778,11 @@ msgid "" "for the appropriate classes defined within this package)::" msgstr "" -#: ../../library/importlib.rst:1445 +#: ../../library/importlib.rst:1599 msgid "Approximating :func:`importlib.import_module`" msgstr "" -#: ../../library/importlib.rst:1447 +#: ../../library/importlib.rst:1601 msgid "" "Import itself is implemented in Python code, making it possible to expose " "most of the import machinery through importlib. The following helps " diff --git a/library/importlib.resources.abc.po b/library/importlib.resources.abc.po index c600f6586d..31ba47eca2 100644 --- a/library/importlib.resources.abc.po +++ b/library/importlib.resources.abc.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 10:36+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -65,38 +65,37 @@ msgid "" "with this ABC should only be returned when the specified module is a package." msgstr "" -#: ../../library/importlib.resources.abc.rst:50 -#: ../../library/importlib.resources.abc.rst:160 +#: ../../library/importlib.resources.abc.rst:48 msgid "Use :class:`importlib.resources.abc.TraversableResources` instead." msgstr "" -#: ../../library/importlib.resources.abc.rst:53 +#: ../../library/importlib.resources.abc.rst:51 msgid "" "Returns an opened, :term:`file-like object` for binary reading of the " "*resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:56 +#: ../../library/importlib.resources.abc.rst:54 msgid "If the resource cannot be found, :exc:`FileNotFoundError` is raised." msgstr "" -#: ../../library/importlib.resources.abc.rst:61 +#: ../../library/importlib.resources.abc.rst:59 msgid "Returns the file system path to the *resource*." msgstr "" -#: ../../library/importlib.resources.abc.rst:63 +#: ../../library/importlib.resources.abc.rst:61 msgid "" "If the resource does not concretely exist on the file system, raise :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/importlib.resources.abc.rst:68 +#: ../../library/importlib.resources.abc.rst:66 msgid "" "Returns ``True`` if the named *name* is considered a resource. :exc:" "`FileNotFoundError` is raised if *name* does not exist." msgstr "" -#: ../../library/importlib.resources.abc.rst:73 +#: ../../library/importlib.resources.abc.rst:71 msgid "" "Returns an :term:`iterable` of strings over the contents of the package. Do " "note that it is not required that all names returned by the iterator be " @@ -104,7 +103,7 @@ msgid "" "`is_resource` would be false." msgstr "" -#: ../../library/importlib.resources.abc.rst:79 +#: ../../library/importlib.resources.abc.rst:77 msgid "" "Allowing non-resource names to be returned is to allow for situations where " "how a package and its resources are stored are known a priori and the non-" @@ -113,68 +112,64 @@ msgid "" "stored on the file system then those subdirectory names can be used directly." msgstr "" -#: ../../library/importlib.resources.abc.rst:87 +#: ../../library/importlib.resources.abc.rst:85 msgid "The abstract method returns an iterable of no items." msgstr "" -#: ../../library/importlib.resources.abc.rst:92 +#: ../../library/importlib.resources.abc.rst:90 msgid "" "An object with a subset of :class:`pathlib.Path` methods suitable for " "traversing directories and opening files." msgstr "" -#: ../../library/importlib.resources.abc.rst:95 +#: ../../library/importlib.resources.abc.rst:93 msgid "" "For a representation of the object on the file-system, use :meth:`importlib." "resources.as_file`." msgstr "" -#: ../../library/importlib.resources.abc.rst:102 -msgid "Use :class:`importlib.resources.abc.Traversable` instead." -msgstr "" - -#: ../../library/importlib.resources.abc.rst:105 +#: ../../library/importlib.resources.abc.rst:98 msgid "Abstract. The base name of this object without any parent references." msgstr "" -#: ../../library/importlib.resources.abc.rst:109 +#: ../../library/importlib.resources.abc.rst:102 msgid "Yield Traversable objects in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:113 +#: ../../library/importlib.resources.abc.rst:106 msgid "Return True if self is a directory." msgstr "" -#: ../../library/importlib.resources.abc.rst:117 +#: ../../library/importlib.resources.abc.rst:110 msgid "Return True if self is a file." msgstr "" -#: ../../library/importlib.resources.abc.rst:121 -#: ../../library/importlib.resources.abc.rst:125 +#: ../../library/importlib.resources.abc.rst:114 +#: ../../library/importlib.resources.abc.rst:118 msgid "Return Traversable child in self." msgstr "" -#: ../../library/importlib.resources.abc.rst:129 +#: ../../library/importlib.resources.abc.rst:122 msgid "" "*mode* may be 'r' or 'rb' to open as text or binary. Return a handle " "suitable for reading (same as :attr:`pathlib.Path.open`)." msgstr "" -#: ../../library/importlib.resources.abc.rst:132 +#: ../../library/importlib.resources.abc.rst:125 msgid "" "When opening as text, accepts encoding parameters such as those accepted by :" "class:`io.TextIOWrapper`." msgstr "" -#: ../../library/importlib.resources.abc.rst:137 +#: ../../library/importlib.resources.abc.rst:130 msgid "Read contents of self as bytes." msgstr "" -#: ../../library/importlib.resources.abc.rst:141 +#: ../../library/importlib.resources.abc.rst:134 msgid "Read contents of self as text." msgstr "" -#: ../../library/importlib.resources.abc.rst:146 +#: ../../library/importlib.resources.abc.rst:139 msgid "" "An abstract base class for resource readers capable of serving the :meth:" "`importlib.resources.files` interface. Subclasses :class:`ResourceReader` " @@ -183,13 +178,13 @@ msgid "" "TraversableResources` also supplies :class:`!ResourceReader`." msgstr "" -#: ../../library/importlib.resources.abc.rst:153 +#: ../../library/importlib.resources.abc.rst:146 msgid "" "Loaders that wish to support resource reading are expected to implement this " "interface." msgstr "" -#: ../../library/importlib.resources.abc.rst:163 +#: ../../library/importlib.resources.abc.rst:151 msgid "" "Returns a :class:`importlib.resources.abc.Traversable` object for the loaded " "package." diff --git a/library/traceback.po b/library/traceback.po index 775bdb77a3..98b2965651 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -117,7 +117,7 @@ msgid "" "exception." msgstr "" -#: ../../library/traceback.rst:73 ../../library/traceback.rst:165 +#: ../../library/traceback.rst:73 ../../library/traceback.rst:168 msgid "The *etype* argument is ignored and inferred from the type of *value*." msgstr "" @@ -183,11 +183,11 @@ msgstr "" msgid "" "Format the exception part of a traceback using an exception value such as " "given by ``sys.last_value``. The return value is a list of strings, each " -"ending in a newline. Normally, the list contains a single string; however, " -"for :exc:`SyntaxError` exceptions, it contains several lines that (when " -"printed) display detailed information about where the syntax error occurred. " -"The message indicating which exception occurred is the always last string in " -"the list." +"ending in a newline. The list contains the exception's message, which is " +"normally a single string; however, for :exc:`SyntaxError` exceptions, it " +"contains several lines that (when printed) display detailed information " +"about where the syntax error occurred. Following the message, the list " +"contains the exception's :attr:`notes `." msgstr "" #: ../../library/traceback.rst:148 @@ -197,7 +197,11 @@ msgid "" "ignored in order to provide backwards compatibility." msgstr "" -#: ../../library/traceback.rst:159 +#: ../../library/traceback.rst:156 +msgid "The returned list now includes any notes attached to the exception." +msgstr "" + +#: ../../library/traceback.rst:162 msgid "" "Format a stack trace and the exception information. The arguments have the " "same meaning as the corresponding arguments to :func:`print_exception`. The " @@ -206,66 +210,66 @@ msgid "" "printed, exactly the same text is printed as does :func:`print_exception`." msgstr "" -#: ../../library/traceback.rst:168 +#: ../../library/traceback.rst:171 msgid "" "This function's behavior and signature were modified to match :func:" "`print_exception`." msgstr "" -#: ../../library/traceback.rst:175 +#: ../../library/traceback.rst:178 msgid "" "This is like ``print_exc(limit)`` but returns a string instead of printing " "to a file." msgstr "" -#: ../../library/traceback.rst:181 +#: ../../library/traceback.rst:184 msgid "A shorthand for ``format_list(extract_tb(tb, limit))``." msgstr "" -#: ../../library/traceback.rst:186 +#: ../../library/traceback.rst:189 msgid "A shorthand for ``format_list(extract_stack(f, limit))``." msgstr "" -#: ../../library/traceback.rst:190 +#: ../../library/traceback.rst:193 msgid "" "Clears the local variables of all the stack frames in a traceback *tb* by " "calling the :meth:`clear` method of each frame object." msgstr "" -#: ../../library/traceback.rst:197 +#: ../../library/traceback.rst:200 msgid "" "Walk a stack following ``f.f_back`` from the given frame, yielding the frame " "and line number for each frame. If *f* is ``None``, the current stack is " "used. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:205 +#: ../../library/traceback.rst:208 msgid "" "Walk a traceback following ``tb_next`` yielding the frame and line number " "for each frame. This helper is used with :meth:`StackSummary.extract`." msgstr "" -#: ../../library/traceback.rst:210 +#: ../../library/traceback.rst:213 msgid "The module also defines the following classes:" msgstr "" -#: ../../library/traceback.rst:213 +#: ../../library/traceback.rst:216 msgid ":class:`TracebackException` Objects" msgstr ":class:`TracebackException` 物件" -#: ../../library/traceback.rst:217 +#: ../../library/traceback.rst:220 msgid "" ":class:`TracebackException` objects are created from actual exceptions to " "capture data for later printing in a lightweight fashion." msgstr "" -#: ../../library/traceback.rst:222 ../../library/traceback.rst:310 +#: ../../library/traceback.rst:225 ../../library/traceback.rst:319 msgid "" "Capture an exception for later rendering. *limit*, *lookup_lines* and " "*capture_locals* are as for the :class:`StackSummary` class." msgstr "" -#: ../../library/traceback.rst:225 +#: ../../library/traceback.rst:228 msgid "" "If *compact* is true, only data that is required by :class:" "`TracebackException`'s ``format`` method is saved in the class attributes. " @@ -273,12 +277,12 @@ msgid "" "is ``None`` and ``__suppress_context__`` is false." msgstr "" -#: ../../library/traceback.rst:230 ../../library/traceback.rst:313 +#: ../../library/traceback.rst:233 ../../library/traceback.rst:322 msgid "" "Note that when locals are captured, they are also shown in the traceback." msgstr "" -#: ../../library/traceback.rst:232 +#: ../../library/traceback.rst:235 msgid "" "*max_group_width* and *max_group_depth* control the formatting of exception " "groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting " @@ -287,140 +291,139 @@ msgid "" "limit is exceeded." msgstr "" -#: ../../library/traceback.rst:240 +#: ../../library/traceback.rst:241 +msgid "Added the *compact* parameter." +msgstr "新增 *compact* 參數。" + +#: ../../library/traceback.rst:244 +msgid "Added the *max_group_width* and *max_group_depth* parameters." +msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" + +#: ../../library/traceback.rst:249 msgid "A :class:`TracebackException` of the original ``__cause__``." msgstr "" -#: ../../library/traceback.rst:244 +#: ../../library/traceback.rst:253 msgid "A :class:`TracebackException` of the original ``__context__``." msgstr "" -#: ../../library/traceback.rst:248 +#: ../../library/traceback.rst:257 msgid "" "If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of :" "class:`TracebackException` instances representing the nested exceptions. " "Otherwise it is ``None``." msgstr "" -#: ../../library/traceback.rst:256 +#: ../../library/traceback.rst:265 msgid "The ``__suppress_context__`` value from the original exception." msgstr "" -#: ../../library/traceback.rst:260 +#: ../../library/traceback.rst:269 msgid "" "The ``__notes__`` value from the original exception, or ``None`` if the " "exception does not have any notes. If it is not ``None`` is it formatted in " "the traceback after the exception string." msgstr "" -#: ../../library/traceback.rst:268 +#: ../../library/traceback.rst:277 msgid "A :class:`StackSummary` representing the traceback." msgstr "" -#: ../../library/traceback.rst:272 +#: ../../library/traceback.rst:281 msgid "The class of the original traceback." msgstr "" -#: ../../library/traceback.rst:276 +#: ../../library/traceback.rst:285 msgid "For syntax errors - the file name where the error occurred." msgstr "" -#: ../../library/traceback.rst:280 +#: ../../library/traceback.rst:289 msgid "For syntax errors - the line number where the error occurred." msgstr "" -#: ../../library/traceback.rst:284 +#: ../../library/traceback.rst:293 msgid "" "For syntax errors - the end line number where the error occurred. Can be " "``None`` if not present." msgstr "" -#: ../../library/traceback.rst:291 +#: ../../library/traceback.rst:300 msgid "For syntax errors - the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:295 +#: ../../library/traceback.rst:304 msgid "For syntax errors - the offset into the text where the error occurred." msgstr "" -#: ../../library/traceback.rst:299 +#: ../../library/traceback.rst:308 msgid "" "For syntax errors - the end offset into the text where the error occurred. " "Can be ``None`` if not present." msgstr "" -#: ../../library/traceback.rst:306 +#: ../../library/traceback.rst:315 msgid "For syntax errors - the compiler error message." msgstr "" -#: ../../library/traceback.rst:317 +#: ../../library/traceback.rst:326 msgid "" "Print to *file* (default ``sys.stderr``) the exception information returned " "by :meth:`format`." msgstr "" -#: ../../library/traceback.rst:324 +#: ../../library/traceback.rst:333 msgid "Format the exception." msgstr "" -#: ../../library/traceback.rst:326 +#: ../../library/traceback.rst:335 msgid "" "If *chain* is not ``True``, ``__cause__`` and ``__context__`` will not be " "formatted." msgstr "" -#: ../../library/traceback.rst:329 +#: ../../library/traceback.rst:338 msgid "" "The return value is a generator of strings, each ending in a newline and " "some containing internal newlines. :func:`~traceback.print_exception` is a " "wrapper around this method which just prints the lines to a file." msgstr "" -#: ../../library/traceback.rst:333 ../../library/traceback.rst:347 -msgid "" -"The message indicating which exception occurred is always the last string in " -"the output." -msgstr "" - -#: ../../library/traceback.rst:338 +#: ../../library/traceback.rst:344 msgid "Format the exception part of the traceback." msgstr "" -#: ../../library/traceback.rst:340 +#: ../../library/traceback.rst:346 msgid "The return value is a generator of strings, each ending in a newline." msgstr "" -#: ../../library/traceback.rst:342 +#: ../../library/traceback.rst:348 msgid "" -"Normally, the generator emits a single string; however, for :exc:" -"`SyntaxError` exceptions, it emits several lines that (when printed) display " -"detailed information about where the syntax error occurred." +"The generator emits the exception's message followed by its notes (if it has " +"any). The exception message is normally a single string; however, for :exc:" +"`SyntaxError` exceptions, it consists of several lines that (when printed) " +"display detailed information about where the syntax error occurred." msgstr "" -#: ../../library/traceback.rst:350 -msgid "Added the *compact* parameter." -msgstr "新增 *compact* 參數。" - -#: ../../library/traceback.rst:353 -msgid "Added the *max_group_width* and *max_group_depth* parameters." -msgstr "新增 *max_group_width* 和 *max_group_depth* 參數。" +#: ../../library/traceback.rst:354 +msgid "The exception's notes are now included in the output." +msgstr "" -#: ../../library/traceback.rst:358 +#: ../../library/traceback.rst:360 msgid ":class:`StackSummary` Objects" msgstr ":class:`StackSummary` 物件" -#: ../../library/traceback.rst:362 +#: ../../library/traceback.rst:364 msgid "" ":class:`StackSummary` objects represent a call stack ready for formatting." msgstr "" -#: ../../library/traceback.rst:368 +#: ../../library/traceback.rst:370 msgid "" "Construct a :class:`StackSummary` object from a frame generator (such as is " "returned by :func:`~traceback.walk_stack` or :func:`~traceback.walk_tb`)." msgstr "" -#: ../../library/traceback.rst:372 +#: ../../library/traceback.rst:374 msgid "" "If *limit* is supplied, only this many frames are taken from *frame_gen*. If " "*lookup_lines* is ``False``, the returned :class:`FrameSummary` objects will " @@ -430,20 +433,20 @@ msgid "" "class:`FrameSummary` are captured as object representations." msgstr "" -#: ../../library/traceback.rst:380 +#: ../../library/traceback.rst:382 msgid "" "Exceptions raised from :func:`repr` on a local variable (when " "*capture_locals* is ``True``) are no longer propagated to the caller." msgstr "" -#: ../../library/traceback.rst:386 +#: ../../library/traceback.rst:388 msgid "" "Construct a :class:`StackSummary` object from a supplied list of :class:" "`FrameSummary` objects or old-style list of tuples. Each tuple should be a " "4-tuple with filename, lineno, name, line as the elements." msgstr "" -#: ../../library/traceback.rst:392 +#: ../../library/traceback.rst:394 msgid "" "Returns a list of strings ready for printing. Each string in the resulting " "list corresponds to a single frame from the stack. Each string ends in a " @@ -451,18 +454,18 @@ msgid "" "with source text lines." msgstr "" -#: ../../library/traceback.rst:397 +#: ../../library/traceback.rst:399 msgid "" "For long sequences of the same frame and line, the first few repetitions are " "shown, followed by a summary line stating the exact number of further " "repetitions." msgstr "" -#: ../../library/traceback.rst:401 +#: ../../library/traceback.rst:403 msgid "Long sequences of repeated frames are now abbreviated." msgstr "" -#: ../../library/traceback.rst:406 +#: ../../library/traceback.rst:408 msgid "" "Returns a string for printing one of the frames involved in the stack. This " "method is called for each :class:`FrameSummary` object to be printed by :" @@ -470,16 +473,16 @@ msgid "" "from the output." msgstr "" -#: ../../library/traceback.rst:415 +#: ../../library/traceback.rst:417 msgid ":class:`FrameSummary` Objects" msgstr ":class:`FrameSummary` 物件" -#: ../../library/traceback.rst:419 +#: ../../library/traceback.rst:421 msgid "" "A :class:`FrameSummary` object represents a single frame in a traceback." msgstr "" -#: ../../library/traceback.rst:423 +#: ../../library/traceback.rst:425 msgid "" "Represent a single frame in the traceback or stack that is being formatted " "or printed. It may optionally have a stringified version of the frames " @@ -492,11 +495,11 @@ msgid "" "display." msgstr "" -#: ../../library/traceback.rst:436 +#: ../../library/traceback.rst:438 msgid "Traceback Examples" msgstr "" -#: ../../library/traceback.rst:438 +#: ../../library/traceback.rst:440 msgid "" "This simple example implements a basic read-eval-print loop, similar to (but " "less useful than) the standard Python interactive interpreter loop. For a " @@ -504,23 +507,23 @@ msgid "" "`code` module. ::" msgstr "" -#: ../../library/traceback.rst:460 +#: ../../library/traceback.rst:462 msgid "" "The following example demonstrates the different ways to print and format " "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:495 +#: ../../library/traceback.rst:497 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:537 +#: ../../library/traceback.rst:539 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:563 +#: ../../library/traceback.rst:565 msgid "This last example demonstrates the final few formatting functions:" msgstr "" diff --git a/sphinx.po b/sphinx.po index 443deb3bf7..7ccdcf1a0d 100644 --- a/sphinx.po +++ b/sphinx.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-26 00:03+0000\n" +"POT-Creation-Date: 2023-09-14 00:03+0000\n" "PO-Revision-Date: 2023-03-15 10:19+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -244,6 +244,11 @@ msgstr "Python 的沿革與授權" msgid "Copyright" msgstr "版權" +#: ../../tools/templates/indexcontent.html:65 +#, fuzzy +msgid "Download the documentation" +msgstr "下載這些說明文件" + #: ../../tools/templates/indexsidebar.html:1 msgid "Download" msgstr "下載"