]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Strip any long path marker in the input to flush_volume.
authorDaira Hopwood <daira@jacaranda.org>
Tue, 27 Oct 2015 21:39:05 +0000 (21:39 +0000)
committerDaira Hopwood <daira@jacaranda.org>
Mon, 25 Jan 2016 15:52:13 +0000 (15:52 +0000)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/util/fileutil.py

index 1133c261c7f54b14652c3a4d7516c872cf30a809..0366daabf694ec9831eddfb7ae8c25dda0aed8d5 100644 (file)
@@ -546,8 +546,12 @@ if sys.platform == "win32":
 
     # <http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/4465cafb-f4ed-434f-89d8-c85ced6ffaa8/>
     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,