66# Translators:
7788# Zombie110year <[email protected] >, 20199+ # Freesand Leo <[email protected] >, 2019910# 1lin24 <[email protected] >, 20191011#
1112#, fuzzy
@@ -72,14 +73,14 @@ msgstr "这个模块定义了以下内容:"
7273msgid ""
7374"Open a gzip-compressed file in binary or text mode, returning a :term:`file "
7475"object`."
75- msgstr "以二进制方式或者文本方式打开一个 gzip 格式的压缩文件,返回一个 :term:`file 文件对象`. "
76+ msgstr "以二进制方式或者文本方式打开一个 gzip 格式的压缩文件,返回一个 :term:`file object`。 "
7677
7778#: ../../library/gzip.rst:34
7879msgid ""
7980"The *filename* argument can be an actual filename (a :class:`str` or "
8081":class:`bytes` object), or an existing file object to read from or write to."
8182msgstr ""
82- "*filename* 参数可以是一个实际的文件字 (一个a :class:`str` 对象或者 :class:`bytes` 对象), "
83+ "*filename* 参数可以是一个实际的文件名 (一个a :class:`str` 对象或者 :class:`bytes` 对象), "
8384"或者是一个用来读写的已存在的文件对象。"
8485
8586#: ../../library/gzip.rst:37
@@ -89,7 +90,7 @@ msgid ""
8990"``'at'``, ``'wt'``, or ``'xt'`` for text mode. The default is ``'rb'``."
9091msgstr ""
9192"*mode* 参数可以是二进制模式: ``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``, ``'wb'``, "
92- "``'x'`` or ``'xb'`` , 或者是文字模式 ``'rt'``, ``'at'``, ``'wt'``, or ``'xt'``。默认值是"
93+ "``'x'`` or ``'xb'`` , 或者是文本模式 ``'rt'``, ``'at'``, ``'wt'``, or ``'xt'``。默认值是"
9394" ``'rb'``。"
9495
9596#: ../../library/gzip.rst:41
@@ -113,6 +114,8 @@ msgid ""
113114":class:`io.TextIOWrapper` instance with the specified encoding, error "
114115"handling behavior, and line ending(s)."
115116msgstr ""
117+ "对于文本模式,将会创建一个 :class:`GzipFile` 对象,并将它封装到一个 :class:`io.TextIOWrapper` 实例中, "
118+ "这个实例默认了指定编码,错误抓获行为和行尾。"
116119
117120#: ../../library/gzip.rst:52
118121msgid ""
@@ -122,7 +125,7 @@ msgstr "支持 *filename* 为一个文件对象,支持文本模式和 *encodin
122125
123126#: ../../library/gzip.rst:56
124127msgid "Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes."
125- msgstr ""
128+ msgstr "支持 ``'x'``, ``'xb'`` 和``'xt'`` 三种模式. "
126129
127130#: ../../library/gzip.rst:59 ../../library/gzip.rst:156
128131msgid "Accepts a :term:`path-like object`."
@@ -135,6 +138,8 @@ msgid ""
135138" method. At least one of *fileobj* and *filename* must be given a non-"
136139"trivial value."
137140msgstr ""
141+ " :class:`GzipFile` 类的构造器支持 :meth:`truncate` 的异常,与:term:`文件对象` "
142+ "的大多数方法非常相似。*fileobj* 和*filename* 至少有一个不为空。"
138143
139144#: ../../library/gzip.rst:69
140145msgid ""
@@ -143,6 +148,8 @@ msgid ""
143148"It defaults to ``None``, in which case *filename* is opened to provide a "
144149"file object."
145150msgstr ""
151+ "新的实例基于 *fileobj*,它可以是一个普通文件,一个 :class:`io.BytesIO` 对象,或者任何一个与文件相似的对象。当 "
152+ "*filename* 是一个文件对象时,它的默认值是 ``None``。"
146153
147154#: ../../library/gzip.rst:74
148155msgid ""
@@ -160,13 +167,17 @@ msgid ""
160167"be read or written. The default is the mode of *fileobj* if discernible; "
161168"otherwise, the default is ``'rb'``."
162169msgstr ""
170+ " *mode* 可以是``'r'``, ``'rb'``, ``'a'``, ``'ab'``, ``'w'``, ``'wb'``, ``'x'``,"
171+ " 或者 ``'xb'``,选择哪个取决于是读文件还是写文件。如果可以分辨是,默认的模式是 *fileobj*,否则为 ``'rb'``。"
163172
164173#: ../../library/gzip.rst:85
165174msgid ""
166175"Note that the file is always opened in binary mode. To open a compressed "
167176"file in text mode, use :func:`.open` (or wrap your :class:`GzipFile` with an"
168177" :class:`io.TextIOWrapper`)."
169178msgstr ""
179+ "需要注意的是,文件默认使用二进制模式打开。如果要以文本模式打开文件一个压缩文件,请使用 :func:`.open` 方法(或者使用 "
180+ ":class:`io.TextIOWrapper` 包装 :class:`GzipFile` )。"
170181
171182#: ../../library/gzip.rst:89
172183msgid ""
@@ -175,6 +186,8 @@ msgid ""
175186"compression, and ``9`` is slowest and produces the most compression. ``0`` "
176187"is no compression. The default is ``9``."
177188msgstr ""
189+ "*compresslevel* 参数是一个从 ``0`` to ``9`` 的整数,用于控制压缩等级;``1`` 最快但压缩比例最小,``9`` "
190+ "最慢但压缩比例最大。 ``0`` 不压缩。默认为 ``9``。"
178191
179192#: ../../library/gzip.rst:94
180193msgid ""
@@ -183,6 +196,8 @@ msgid ""
183196" be provided in compression mode. If omitted or ``None``, the current time "
184197"is used. See the :attr:`mtime` attribute for more details."
185198msgstr ""
199+ " *mtime* 参数是一个可选的数字时间戳用于写入流的最后修改字段,。*mtime* 只在压缩模式中使用。如果省略或者值为 "
200+ "``None``,则使用当前时间。更多细节,详见 :attr:`mtime` 属性。"
186201
187202#: ../../library/gzip.rst:99
188203msgid ""
@@ -239,7 +254,7 @@ msgstr ""
239254msgid ""
240255"Support for the :keyword:`with` statement was added, along with the *mtime* "
241256"constructor argument and :attr:`mtime` attribute."
242- msgstr ""
257+ msgstr "支持 :keyword:`with` 语句,构造器参数 *mtime* 和 :attr:`mtime` 属性。 "
243258
244259#: ../../library/gzip.rst:141
245260msgid "Support for zero-padded and unseekable files was added."
@@ -251,14 +266,16 @@ msgstr "实现 :meth:`io.BufferedIOBase.read1` 方法。"
251266
252267#: ../../library/gzip.rst:147
253268msgid "Added support for the ``'x'`` and ``'xb'`` modes."
254- msgstr "增加了对 ``'x'`` and ``'xb'`` 两种模式的支持 。"
269+ msgstr "支持 ``'x'`` and ``'xb'`` 两种模式 。"
255270
256271#: ../../library/gzip.rst:150
257272msgid ""
258273"Added support for writing arbitrary :term:`bytes-like objects <bytes-like "
259274"object>`. The :meth:`~io.BufferedIOBase.read` method now accepts an argument"
260275" of ``None``."
261276msgstr ""
277+ "支持写入任意 :term:`类字节对象 <bytes-like object>`。:meth:`~io.BufferedIOBase.read` "
278+ "方法可以接受``None``为参数。"
262279
263280#: ../../library/gzip.rst:162
264281msgid ""
@@ -281,19 +298,19 @@ msgstr "用法示例"
281298
282299#: ../../library/gzip.rst:181
283300msgid "Example of how to read a compressed file::"
284- msgstr "如何读取一个压缩文件 :"
301+ msgstr "读取压缩文件示例 :"
285302
286303#: ../../library/gzip.rst:187
287304msgid "Example of how to create a compressed GZIP file::"
288- msgstr "如何创建一个 GZIP 文件 :"
305+ msgstr "创建GZIP 文件示例 :"
289306
290307#: ../../library/gzip.rst:194
291308msgid "Example of how to GZIP compress an existing file::"
292- msgstr "如何使用 GZIP 压缩一个已有的文件 :"
309+ msgstr "使用 GZIP 压缩已有的文件示例 :"
293310
294311#: ../../library/gzip.rst:202
295312msgid "Example of how to GZIP compress a binary string::"
296- msgstr "如何使用 GZIP 压缩一个二进制串 :"
313+ msgstr "使用 GZIP 压缩二进制字符串示例 :"
297314
298315#: ../../library/gzip.rst:211
299316msgid "Module :mod:`zlib`"
0 commit comments