@@ -27,11 +27,11 @@ msgstr ""
2727
2828#: ../../library/zipfile.rst:2
2929msgid ":mod:`zipfile` --- Work with ZIP archives"
30- msgstr ""
30+ msgstr ":mod:`zipfile` --- 在 ZIP 归档中工作 "
3131
3232#: ../../library/zipfile.rst:10
3333msgid "**Source code:** :source:`Lib/zipfile.py`"
34- msgstr ""
34+ msgstr "**源代码:** :source:`Lib/zipfile.py` "
3535
3636#: ../../library/zipfile.rst:14
3737msgid ""
@@ -40,6 +40,8 @@ msgid ""
4040"Any advanced use of this module will require an understanding of the format,"
4141" as defined in `PKZIP Application Note`_."
4242msgstr ""
43+ "ZIP 文件格式是一个常用的归档与压缩标准。这个模块提供了创建、读取、写入、添加以及列出 ZIP 文件的工具。任何此模块的进阶用法需要理解此格式,如在 "
44+ "`PKZIP 应用程序笔记 <PKZIP Application Note>`_ 中的定义。"
4345
4446#: ../../library/zipfile.rst:19
4547msgid ""
@@ -49,35 +51,37 @@ msgid ""
4951"archives, but it currently cannot create an encrypted file. Decryption is "
5052"extremely slow as it is implemented in native Python rather than C."
5153msgstr ""
54+ "此模块目前不能处理分卷 ZIP 文件。它可以处理使用 ZIP64 扩展(超过 4 GB 的 ZIP 文件)的 ZIP 文件。它支持解密 ZIP "
55+ "归档中的加密文件,但是目前不能创建一个加密的文件。解密非常慢,因为它是使用原生 Python 而不是 C 实现的。"
5256
5357#: ../../library/zipfile.rst:26
5458msgid "The module defines the following items:"
5559msgstr "这个模块定义了以下内容:"
5660
5761#: ../../library/zipfile.rst:30
5862msgid "The error raised for bad ZIP files."
59- msgstr ""
63+ msgstr "为损坏的 ZIP 文件抛出的错误。 "
6064
6165#: ../../library/zipfile.rst:37
6266msgid ""
6367"Alias of :exc:`BadZipFile`, for compatibility with older Python versions."
64- msgstr ""
68+ msgstr ":exc:`BadZipFile` 的别名,与旧版本 Python 保持兼容性。 "
6569
6670#: ../../library/zipfile.rst:44
6771msgid ""
6872"The error raised when a ZIP file would require ZIP64 functionality but that "
6973"has not been enabled."
70- msgstr ""
74+ msgstr "当 ZIP 文件取药 ZIP64 功能但是未启用时抛出此错误。 "
7175
7276#: ../../library/zipfile.rst:51
7377msgid ""
7478"The class for reading and writing ZIP files. See section :ref:`zipfile-"
7579"objects` for constructor details."
76- msgstr ""
80+ msgstr "用于读写 ZIP 文件的类。 欲了解构造函数的描述,参阅段落 :ref:`zipfile-objects`。 "
7781
7882#: ../../library/zipfile.rst:58
7983msgid "Class for creating ZIP archives containing Python libraries."
80- msgstr ""
84+ msgstr "用于创建包含 Python 库的 ZIP 归档的类。 "
8185
8286#: ../../library/zipfile.rst:63
8387msgid ""
@@ -90,39 +94,45 @@ msgid ""
9094"of the last modification to the file; the fields are described in section "
9195":ref:`zipinfo-objects`."
9296msgstr ""
97+ "用于表示归档内一个成员信息的类。此类的实例由 :class:`ZipFile` 的 :meth:`.getinfo` 和 "
98+ ":meth:`.infolist` 方法返回。大多数使用此模块的用户都不需要创建它,只需要使用由模块创建的它们。 *filename* "
99+ "应当是归档成员的全名, *date_time* 应当是包含六个字段的描述最近修改时间的元组,这些字段在章节 :ref:`zipinfo-objects`"
100+ " 中描述。"
93101
94102#: ../../library/zipfile.rst:75
95103msgid ""
96104"Returns ``True`` if *filename* is a valid ZIP file based on its magic "
97105"number, otherwise returns ``False``. *filename* may be a file or file-like "
98106"object too."
99107msgstr ""
108+ "根据文件的 Magic Number,如果 *filename* 是一个有效的 ZIP 文件则返回 ``True``,否则返回 ``False``。 "
109+ "*filename* 也可能是一个文件或类文件对象。"
100110
101111#: ../../library/zipfile.rst:78
102112msgid "Support for file and file-like objects."
103- msgstr ""
113+ msgstr "支持文件或类文件对象。 "
104114
105115#: ../../library/zipfile.rst:84
106116msgid "The numeric constant for an uncompressed archive member."
107- msgstr ""
117+ msgstr "未被压缩的归档成员的数字常数。 "
108118
109119#: ../../library/zipfile.rst:89
110120msgid ""
111121"The numeric constant for the usual ZIP compression method. This requires "
112122"the :mod:`zlib` module."
113- msgstr ""
123+ msgstr "常用的 ZIP 压缩方法的数字常数。需要 :mod:`zlib` 模块。 "
114124
115125#: ../../library/zipfile.rst:95
116126msgid ""
117127"The numeric constant for the BZIP2 compression method. This requires the "
118128":mod:`bz2` module."
119- msgstr ""
129+ msgstr "BZIP2 压缩方法的数字常数。需要 :mod:`bz2` 模块。 "
120130
121131#: ../../library/zipfile.rst:102
122132msgid ""
123133"The numeric constant for the LZMA compression method. This requires the "
124134":mod:`lzma` module."
125- msgstr ""
135+ msgstr "LZMA 压缩方法的数字常数。需要 :mod:`lzma` 模块。 "
126136
127137#: ../../library/zipfile.rst:109
128138msgid ""
@@ -132,36 +142,39 @@ msgid ""
132142"and may either refuse to process the ZIP file altogether, or fail to extract"
133143" individual files."
134144msgstr ""
145+ "ZIP 文件格式规范包括自 2001 年以来对 bzip2 压缩的支持,以及自 2006 年以来对 LZMA 压缩的支持。但是,一些工具(包括较旧的 "
146+ "Python 版本)不支持这些压缩方法,并且可能拒绝完全处理 ZIP 文件,或者无法提取单个文件。"
135147
136148#: ../../library/zipfile.rst:120
137149msgid "`PKZIP Application Note`_"
138- msgstr ""
150+ msgstr "`PKZIP 应用程序笔记 <PKZIP Application Note>`_ "
139151
140152#: ../../library/zipfile.rst:119
141153msgid ""
142154"Documentation on the ZIP file format by Phil Katz, the creator of the format"
143155" and algorithms used."
144- msgstr ""
156+ msgstr "Phil Katz 编写的 ZIP 文件格式文档,此格式和使用的算法的创建者。 "
145157
146158#: ../../library/zipfile.rst:123
147159msgid "`Info-ZIP Home Page <http://www.info-zip.org/>`_"
148- msgstr ""
160+ msgstr "`Info-ZIP 主页 <http://www.info-zip.org/>`_ "
149161
150162#: ../../library/zipfile.rst:123
151163msgid ""
152164"Information about the Info-ZIP project's ZIP archive programs and "
153165"development libraries."
154- msgstr ""
166+ msgstr "有关 Info-ZIP 项目的 ZIP 存档程序和开发库的信息。 "
155167
156168#: ../../library/zipfile.rst:130
157169msgid "ZipFile Objects"
158- msgstr ""
170+ msgstr "ZipFile 对象 "
159171
160172#: ../../library/zipfile.rst:136
161173msgid ""
162174"Open a ZIP file, where *file* can be a path to a file (a string), a file-"
163175"like object or a :term:`path-like object`."
164176msgstr ""
177+ "打开一个 ZIP 文件,*file* 为一个指向文件的路径(字符串),一个类文件对象或者一个 :term:`path-like objdect`。"
165178
166179#: ../../library/zipfile.rst:139
167180msgid ""
@@ -176,6 +189,12 @@ msgid ""
176189"``'a'`` and the file does not exist at all, it is created. If *mode* is "
177190"``'r'`` or ``'a'``, the file should be seekable."
178191msgstr ""
192+ "形参 *mode* 应当为 ``'r'`` 来读取一个存在的文件,``'w'`` 来截断并写入新的文件, ``'a'`` 来添加到一个存在的文件,或者 "
193+ "``'x'`` 来仅新建并写入新的文件。如果 *mode* 为 ``'x'`` 并且 *file* 指向已经存在的文件,则抛出 "
194+ ":exc:`FileExistsError`。如果 *mode* 为 ``'a'`` 且 *file* 为已存在的文件,则格外的文件将被加入。如果 "
195+ "*file* 不指向 ZIP 文件,之后一个新的 ZIP 归档将被追加为此文件。这是为了将 ZIP 归档添加到另一个文件(例如 "
196+ ":file:`python.exe`)。如果 *mode* 为 ``'a'`` 并且文件不存在, 则会新建。如果 *mode* 为 ``'r'`` 或 "
197+ "``'a'``, 则文件应当可定位。"
179198
180199#: ../../library/zipfile.rst:151
181200msgid ""
0 commit comments