@@ -202,25 +202,22 @@ class S3FS(FS):
202202 `PyFilesystem <https://pyfilesystem.org>`_
203203
204204 :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
210208 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.
211211 :param str endpoint_url: Alternative endpoint url (``None`` to use
212212 default).
213213 :param str aws_session_token:
214214 :param str region: Optional S3 region.
215215 :param str delimiter: The delimiter to separate folders, defaults to
216216 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.
224221
225222 """
226223
@@ -612,9 +609,10 @@ def setinfo(self, path, info):
612609
613610 def getbytes (self , path ):
614611 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 )
618616 _path = self .validatepath (path )
619617 _key = self ._path_to_key (_path )
620618 bytes_file = io .BytesIO ()
0 commit comments