From 669d10e6be8e18face4e29b28427e964f7e38b5e Mon Sep 17 00:00:00 2001 From: Ratanak Date: Tue, 1 Jan 2013 17:44:11 +0000 Subject: [PATCH] Fix #2240 : Win32 freespace issue with large capacity drives --- deluge/common.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deluge/common.py b/deluge/common.py index 033bbd2ef..eb2d048d2 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -529,9 +529,8 @@ def free_space(path): raise InvalidPathError("%s is not a valid path" % path) if windows_check(): - import win32file - sectors, bytes, free, total = map(long, win32file.GetDiskFreeSpace(path)) - return (free * sectors * bytes) + from win32file import GetDiskFreeSpaceEx + return GetDiskFreeSpaceEx(path)[0] else: disk_data = os.statvfs(path.encode("utf8")) block_size = disk_data.f_frsize