Skip to content

Commit 53f6e14

Browse files
committed
Deprecate FS.getbasic since it is superseded by FS.getinfo
1 parent 65ad3f7 commit 53f6e14

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

fs/base.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ def opendir(
12091209

12101210
_factory = factory or self.subfs_class or SubFS
12111211

1212-
if not self.getbasic(path).is_dir:
1212+
if not self.getinfo(path).is_dir:
12131213
raise errors.DirectoryExpected(path=path)
12141214
return _factory(self, path)
12151215

@@ -1553,7 +1553,16 @@ def getbasic(self, path):
15531553
Returns:
15541554
~fs.info.Info: Resource information object for ``path``.
15551555
1556+
Note:
1557+
.. deprecated:: 2.4.13
1558+
Please use `~FS.getinfo` directly, which is
1559+
required to always return the *basic* namespace.
1560+
15561561
"""
1562+
warnings.warn(
1563+
"method 'getbasic' has been deprecated, please use 'getinfo'",
1564+
DeprecationWarning,
1565+
)
15571566
return self.getinfo(path, namespaces=["basic"])
15581567

15591568
def getdetails(self, path):

0 commit comments

Comments
 (0)