Fix free_space calculating incorrectly when using mounted drives.

If the file is on a drive mounted to a path, it was previously
calculating the free space on the mount drive, instead of whatever
the moveto drive was.
This commit is contained in:
voussoir 2020-08-23 22:20:04 -07:00
parent 57e56f3f02
commit 1d97479f41

View file

@ -107,7 +107,8 @@ def assert_enough_space(pathsize, workdir, moveto, rec, rev, par):
if moveto is not None:
moveto_drive = os.path.splitdrive(moveto.absolute_path)[0]
free_space = min(free_space, shutil.disk_usage(moveto_drive).free)
moveto_drive = pathclass.Path(moveto_drive)
free_space = min(free_space, shutil.disk_usage(moveto_drive.absolute_path).free)
message = ' '.join([
f'For {bytestring.bytestring(pathsize)},',