Fix backup in directory format on Windows.

This commit is contained in:
Akshay Joshi
2018-07-17 13:04:28 +01:00
committed by Dave Page
parent ba8f745f70
commit 1fc82d328c
2 changed files with 13 additions and 1 deletions

View File

@@ -223,6 +223,8 @@ if IS_WIN:
buf_size = len(_path)
while True:
res = ctypes.create_unicode_buffer(buf_size)
# Note:- _GetShortPathNameW may return empty value
# if directory doesn't exist.
needed = _GetShortPathNameW(_path, res, buf_size)
if buf_size >= needed: