Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
common DEFAULT_WRITE_BUFFER_SIZE
  • Loading branch information
CCLDArjun committed Feb 18, 2023
commit d1618f26050f3a5abcca8625a1aa85fa2beaed6e
6 changes: 4 additions & 2 deletions Lib/gzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
_COMPRESS_LEVEL_BEST = 9

READ_BUFFER_SIZE = 128 * 1024
DEFAULT_WRITE_BUFFER_SIZE = 4 * io.DEFAULT_BUFFER_SIZE


def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_BEST,
encoding=None, errors=None, newline=None, buffer_size=4*io.DEFAULT_BUFFER_SIZE):
encoding=None, errors=None, newline=None,
buffer_size=DEFAULT_WRITE_BUFFER_SIZE):
"""Open a gzip-compressed file in binary or text mode.

The filename argument can be an actual filename (a str or bytes object), or
Expand Down Expand Up @@ -150,7 +152,7 @@ class GzipFile(_compression.BaseStream):

def __init__(self, filename=None, mode=None,
compresslevel=_COMPRESS_LEVEL_BEST, fileobj=None, mtime=None,
buffer_size=4*io.DEFAULT_BUFFER_SIZE):
buffer_size=DEFAULT_WRITE_BUFFER_SIZE):
"""Constructor for the GzipFile class.

At least one of fileobj and filename must be given a
Expand Down