From f8856193d355a1733eb9553920d4ff35684d01f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Sun, 3 Nov 2019 17:40:34 +0100 Subject: [PATCH] Replaced usage of os.statvfs with shutil.disk_usage The RepositoryCache used `os.statvfs` which is not available on Windows. `shutil.disk_usage` provides the same information but in a cross platform way. --- src/borg/remote.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/borg/remote.py b/src/borg/remote.py index ecf438367..6e756d974 100644 --- a/src/borg/remote.py +++ b/src/borg/remote.py @@ -1112,8 +1112,7 @@ class RepositoryCache(RepositoryNoCache): self.enospc = 0 def query_size_limit(self): - stat_fs = os.statvfs(self.basedir) - available_space = stat_fs.f_bavail * stat_fs.f_frsize + available_space = shutil.disk_usage(self.basedir).free self.size_limit = int(min(available_space * 0.25, 2**31)) def key_filename(self, key):