1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-27 02:08:54 +00:00

Merge pull request #4816 from jrast/fix-statvfs

Replaced usage of os.statvfs with shutil.disk_usage
This commit is contained in:
TW 2019-11-03 20:26:25 +01:00 committed by GitHub
commit 1200690a3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1116,8 +1116,7 @@ def __init__(self, repository, pack=None, unpack=None, transform=None):
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):