@@ -34,16 +34,16 @@ def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_TRADEOFF,
3434 encoding = None , errors = None , newline = None , * , mtime = None ):
3535 """Open a gzip-compressed file in binary or text mode.
3636
37- The filename argument can be an actual filename (a str or bytes object), or
38- an existing file object to read from or write to.
37+ The filename argument can be an actual filename (a str or bytes object),
38+ or an existing file object to read from or write to.
3939
40- The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for
41- binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is
42- "rb", and the default compresslevel is 9.
40+ The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab"
41+ for binary mode, or "rt", "wt", "xt" or "at" for text mode. The default
42+ mode is "rb", and the default compresslevel is 9.
4343
44- For binary mode, this function is equivalent to the GzipFile constructor:
45- GzipFile(filename, mode, compresslevel). In this case, the encoding, errors
46- and newline arguments must not be provided.
44+ For binary mode, this function is equivalent to the GzipFile
45+ constructor: GzipFile(filename, mode, compresslevel). In this case,
46+ the encoding, errors and newline arguments must not be provided.
4747
4848 For text mode, a GzipFile object is created, and wrapped in an
4949 io.TextIOWrapper instance with the specified encoding, error handling
@@ -149,8 +149,8 @@ class GzipFile(_streams.BaseStream):
149149 """The GzipFile class simulates most of the methods of a file object with
150150 the exception of the truncate() method.
151151
152- This class only supports opening files in binary mode. If you need to open a
153- compressed file in text mode, use the gzip.open() function.
152+ This class only supports opening files in binary mode. If you need to
153+ open a compressed file in text mode, use the gzip.open() function.
154154
155155 """
156156
@@ -166,33 +166,34 @@ def __init__(self, filename=None, mode=None,
166166 non-trivial value.
167167
168168 The new class instance is based on fileobj, which can be a regular
169- file, an io.BytesIO object, or any other object which simulates a file.
170- It defaults to None, in which case filename is opened to provide
171- a file object.
169+ file, an io.BytesIO object, or any other object which simulates
170+ a file. It defaults to None, in which case filename is opened to
171+ provide a file object.
172172
173173 When fileobj is not None, the filename argument is only used to be
174174 included in the gzip file header, which may include the original
175175 filename of the uncompressed file. It defaults to the filename of
176176 fileobj, if discernible; otherwise, it defaults to the empty string,
177- and in this case the original filename is not included in the header.
178-
179- The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or
180- 'xb' depending on whether the file will be read or written. The default
181- is the mode of fileobj if discernible; otherwise, the default is 'rb'.
182- A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and
183- 'wb', 'a' and 'ab', and 'x' and 'xb'.
184-
185- The compresslevel argument is an integer from 0 to 9 controlling the
186- level of compression; 1 is fastest and produces the least compression,
187- and 9 is slowest and produces the most compression. 0 is no compression
188- at all. The default is 9.
189-
190- The optional mtime argument is the timestamp requested by gzip. The time
191- is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970.
192- Set mtime to 0 to generate a compressed stream that does not depend on
193- creation time. If mtime is omitted or None, the current time is used.
194- If the resulting mtime is outside the range 0 to 2**32-1, then the
195- value 0 is used instead.
177+ and in this case the original filename is not included in the
178+ header.
179+
180+ The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb',
181+ 'x', or 'xb' depending on whether the file will be read or written.
182+ The default is the mode of fileobj if discernible; otherwise, the
183+ default is 'rb'. A mode of 'r' is equivalent to one of 'rb', and
184+ similarly for 'w' and 'wb', 'a' and 'ab', and 'x' and 'xb'.
185+
186+ The compresslevel argument is an integer from 0 to 9 controlling
187+ the level of compression; 1 is fastest and produces the least
188+ compression, and 9 is slowest and produces the most compression.
189+ 0 is no compression at all. The default is 9.
190+
191+ The optional mtime argument is the timestamp requested by gzip.
192+ The time is in Unix format, i.e., seconds since 00:00:00 UTC,
193+ January 1, 1970. Set mtime to 0 to generate a compressed stream
194+ that does not depend on creation time. If mtime is omitted or None,
195+ the current time is used. If the resulting mtime is outside the
196+ range 0 to 2**32-1, then the value 0 is used instead.
196197
197198 """
198199
0 commit comments