Skip to content

Commit

Permalink
added buffer_size parameter to http module (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
mullenkamp authored Oct 16, 2022
1 parent 9449c37 commit d79ab9f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions smart_open/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def open_uri(uri, mode, transport_params):


def open(uri, mode, kerberos=False, user=None, password=None, cert=None,
headers=None, timeout=None):
headers=None, timeout=None, buffer_size=DEFAULT_BUFFER_SIZE):
"""Implement streamed reader from a web site.
Supports Kerberos and Basic HTTP authentication.
Expand All @@ -73,6 +73,8 @@ def open(uri, mode, kerberos=False, user=None, password=None, cert=None,
Any headers to send in the request. If ``None``, the default headers are sent:
``{'Accept-Encoding': 'identity'}``. To use no headers at all,
set this variable to an empty dict, ``{}``.
buffer_size: int, optional
The buffer size to use when performing I/O.
Note
----
Expand All @@ -82,7 +84,7 @@ def open(uri, mode, kerberos=False, user=None, password=None, cert=None,
"""
if mode == constants.READ_BINARY:
fobj = SeekableBufferedInputBase(
uri, mode, kerberos=kerberos,
uri, mode, buffer_size=buffer_size, kerberos=kerberos,
user=user, password=password, cert=cert,
headers=headers, timeout=timeout,
)
Expand Down

0 comments on commit d79ab9f

Please sign in to comment.