@@ -34,16 +34,16 @@ def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_BEST,
3434 encoding = None , errors = None , newline = 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
@@ -148,8 +148,8 @@ class GzipFile(_streams.BaseStream):
148148 """The GzipFile class simulates most of the methods of a file object with
149149 the exception of the truncate() method.
150150
151- This class only supports opening files in binary mode. If you need to open a
152- compressed file in text mode, use the gzip.open() function.
151+ This class only supports opening files in binary mode. If you need to
152+ open a compressed file in text mode, use the gzip.open() function.
153153
154154 """
155155
@@ -165,31 +165,33 @@ def __init__(self, filename=None, mode=None,
165165 non-trivial value.
166166
167167 The new class instance is based on fileobj, which can be a regular
168- file, an io.BytesIO object, or any other object which simulates a file.
169- It defaults to None, in which case filename is opened to provide
170- a file object.
168+ file, an io.BytesIO object, or any other object which simulates
169+ a file. It defaults to None, in which case filename is opened to
170+ provide a file object.
171171
172172 When fileobj is not None, the filename argument is only used to be
173173 included in the gzip file header, which may include the original
174174 filename of the uncompressed file. It defaults to the filename of
175175 fileobj, if discernible; otherwise, it defaults to the empty string,
176- and in this case the original filename is not included in the header.
177-
178- The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or
179- 'xb' depending on whether the file will be read or written. The default
180- is the mode of fileobj if discernible; otherwise, the default is 'rb'.
181- A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and
182- 'wb', 'a' and 'ab', and 'x' and 'xb'.
183-
184- The compresslevel argument is an integer from 0 to 9 controlling the
185- level of compression; 1 is fastest and produces the least compression,
186- and 9 is slowest and produces the most compression. 0 is no compression
187- at all. The default is 9.
188-
189- The optional mtime argument is the timestamp requested by gzip. The time
190- is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970.
191- If mtime is omitted or None, the current time is used. Use mtime = 0
192- to generate a compressed stream that does not depend on creation time.
176+ and in this case the original filename is not included in the
177+ header.
178+
179+ The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb',
180+ 'x', or 'xb' depending on whether the file will be read or written.
181+ The default is the mode of fileobj if discernible; otherwise, the
182+ default is 'rb'. A mode of 'r' is equivalent to one of 'rb', and
183+ similarly for 'w' and 'wb', 'a' and 'ab', and 'x' and 'xb'.
184+
185+ The compresslevel argument is an integer from 0 to 9 controlling
186+ the level of compression; 1 is fastest and produces the least
187+ compression, and 9 is slowest and produces the most compression.
188+ 0 is no compression at all. The default is 9.
189+
190+ The optional mtime argument is the timestamp requested by gzip.
191+ The time is in Unix format, i.e., seconds since 00:00:00 UTC,
192+ January 1, 1970. If mtime is omitted or None, the current time
193+ is used. Use mtime = 0 to generate a compressed stream that does
194+ not depend on creation time.
193195
194196 """
195197
0 commit comments