Skip to content

Commit 47b6239

Browse files
committed
Add disclaimer about the writeable parameter of fs.open_fs
1 parent e6f0c8f commit 47b6239

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

fs/opener/registry.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ def open_fs(
198198
"""Open a filesystem from a FS URL (ignoring the path component).
199199
200200
Arguments:
201-
fs_url (str): A filesystem URL.
201+
fs_url (str): A filesystem URL. If a filesystem instance is
202+
given instead, it will be returned transparently.
202203
writeable (bool, optional): `True` if the filesystem must
203204
be writeable.
204205
create (bool, optional): `True` if the filesystem should be
@@ -211,6 +212,14 @@ def open_fs(
211212
Returns:
212213
~fs.base.FS: A filesystem instance.
213214
215+
Caution:
216+
The ``writeable`` parameter only controls whether the
217+
filesystem *needs* to be writable, which is relevant for
218+
some archive filesystems. Passing ``writeable=False`` will
219+
**not** make the return filesystem read-only. For this,
220+
consider using `fs.wrap.WrapReadOnly` to wrap the returned
221+
instance.
222+
214223
"""
215224
from ..base import FS
216225

0 commit comments

Comments
 (0)