-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FakeShutilModule.disk_usage() does not accept Path objects, in contrast to shutil.disk_usage() #699
Labels
Comments
Thanks - yes, this is an error. Usually it is documented if a |
mrbean-bremen
added a commit
to mrbean-bremen/pyfakefs
that referenced
this issue
Aug 8, 2022
mrbean-bremen
added a commit
to mrbean-bremen/pyfakefs
that referenced
this issue
Aug 8, 2022
mrbean-bremen
added a commit
to mrbean-bremen/pyfakefs
that referenced
this issue
Aug 8, 2022
@spezold - should be fixed in master now, please check! |
@mrbean-bremen Wow, thanks a lot for your rapid response. I can confirm that it works (just checked with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An unpached
shutil.disk_usage()
function happily accepts instances ofpathlib.Path
for itspath
parameter. However, withpyfakefs
, this does not seem to work; at least on my system (Windows 10, Python 3.7.9 withpyfakefs
4.6.3 and Python 3.10.5 withpyfakefs
4.5.6). Here is a minimum working example:pyfakefs
4.6.3, I get:TypeError: 'WindowsPath' object is not subscriptable
pyfakefs
4.5.6, I get:AttributeError: 'WindowsPath' object has no attribute 'startswith'
From what I saw, both errors seem to result from the fact that
FakeShutilModule.disk_usage()
simply passes itspath
parameter tofilesystem.get_disk_usage()
. This, in my case, is aFakeFilesystem
instance, whoseget_disk_usage()
explicitly seems to accept strings only for itspath
parameter.Is this an error? Or am I doing something wrong here?
The text was updated successfully, but these errors were encountered: