From 39d1796e2d119d11e1a1ab022319e74a34009b78 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Tue, 27 Oct 2015 21:39:05 +0000 Subject: [PATCH] Strip any long path marker in the input to flush_volume. Signed-off-by: Daira Hopwood --- src/allmydata/util/fileutil.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/allmydata/util/fileutil.py b/src/allmydata/util/fileutil.py index 1133c261..0366daab 100644 --- a/src/allmydata/util/fileutil.py +++ b/src/allmydata/util/fileutil.py @@ -546,8 +546,12 @@ if sys.platform == "win32": # def flush_volume(path): - drive = os.path.splitdrive(os.path.realpath(path))[0] + abspath = os.path.realpath(path) + if abspath.startswith("\\\\?\\"): + abspath = abspath[4 :] + drive = os.path.splitdrive(abspath)[0] + print "flushing %r" % (drive,) hVolume = CreateFileW(u"\\\\.\\" + drive, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, -- 2.45.2