Add os.sep to workdrive_drive splitdrive to fix disk usage reading.

Splitdrive returns "C:" on Windows and "" on Linux, and passing this
into disk_usage actually returns info about the cwd disk.
This commit is contained in:
voussoir 2020-10-29 15:53:03 -07:00
parent 6552740df9
commit 907842d5cc

View file

@ -118,7 +118,7 @@ def assert_enough_space(pathsize, workdir, moveto, rec, rev, par):
needed = pathsize * (1 + plus_percent)
reserve = RESERVE_SPACE_ON_DRIVE + needed
workdir_drive = os.path.splitdrive(workdir.absolute_path)[0]
workdir_drive = os.path.splitdrive(workdir.absolute_path)[0] + os.sep
free_space = shutil.disk_usage(workdir_drive).free
if moveto is not None: