@@ -202,25 +202,22 @@ class S3FS(FS):
202
202
`PyFilesystem <https://pyfilesystem.org>`_
203
203
204
204
:param str bucket_name: The S3 bucket name.
205
- :param str dir_path: The root directory within the S3 Bucker.
206
- Defaults to "/""
207
- :param str aws_access_key_id: The access key, or None to read the
208
- key from standard configuration files.
209
- :param str aws_secret_access_key: The secret key, or None to read
205
+ :param str dir_path: The root directory within the S3 Bucket.
206
+ Defaults to ``"/"``
207
+ :param str aws_access_key_id: The access key, or ``None`` to read
210
208
the key from standard configuration files.
209
+ :param str aws_secret_access_key: The secret key, or ``None`` to
210
+ read the key from standard configuration files.
211
211
:param str endpoint_url: Alternative endpoint url (``None`` to use
212
212
default).
213
213
:param str aws_session_token:
214
214
:param str region: Optional S3 region.
215
215
:param str delimiter: The delimiter to separate folders, defaults to
216
216
a forward slash.
217
- :param bool strict: Validate correctness of the destination path.
218
- For example, throw exception FileExpected() when a directory
219
- path is supplied to ``setbinfile()`` method.
220
- These validations are quite expensive and normally can be
221
- safely disabled, assuming the client application doesn't mess
222
- with file paths intentionally.
223
- Defaults to ``True``.
217
+ :param bool strict: When ``True`` (default) S3FS will follow the
218
+ PyFilesystem specification exactly. Set to ``False`` to disable
219
+ validation of destination paths which may speed up uploads /
220
+ downloads.
224
221
225
222
"""
226
223
@@ -612,9 +609,10 @@ def setinfo(self, path, info):
612
609
613
610
def getbytes (self , path ):
614
611
self .check ()
615
- info = self .getinfo (path )
616
- if not info .is_file :
617
- raise errors .FileExpected (path )
612
+ if self .strict :
613
+ info = self .getinfo (path )
614
+ if not info .is_file :
615
+ raise errors .FileExpected (path )
618
616
_path = self .validatepath (path )
619
617
_key = self ._path_to_key (_path )
620
618
bytes_file = io .BytesIO ()
0 commit comments