Commit 87a736d5 by willmcgugan

Support for Windows long paths in opener, and multifs fix

parent 0ae89aa3
...@@ -94,7 +94,7 @@ class MultiFS(FS): ...@@ -94,7 +94,7 @@ class MultiFS(FS):
self.auto_close = auto_close self.auto_close = auto_close
self.fs_sequence = [] self.fs_sequence = []
self.fs_lookup = {} self.fs_lookup = {}
self.write_fs = None self.writefs = None
@synchronize @synchronize
def __str__(self): def __str__(self):
...@@ -112,12 +112,12 @@ class MultiFS(FS): ...@@ -112,12 +112,12 @@ class MultiFS(FS):
if self.auto_close: if self.auto_close:
for fs in self.fs_sequence: for fs in self.fs_sequence:
fs.close() fs.close()
if self.write_fs is not None: if self.writefs is not None:
self.write_fs.close() self.writefs.close()
# Discard any references # Discard any references
del self.fs_sequence[:] del self.fs_sequence[:]
self.fs_lookup.clear() self.fs_lookup.clear()
self.write_fs = None self.writefs = None
super(MultiFS, self).close() super(MultiFS, self).close()
@synchronize @synchronize
......
...@@ -84,6 +84,8 @@ class NoOpenerError(OpenerError): ...@@ -84,6 +84,8 @@ class NoOpenerError(OpenerError):
def _expand_syspath(path): def _expand_syspath(path):
if path is None: if path is None:
return path return path
if path.startswith('\\\\?\\'):
path = path[4:]
path = os.path.expanduser(os.path.expandvars(path)) path = os.path.expanduser(os.path.expandvars(path))
path = os.path.normpath(os.path.abspath(path)) path = os.path.normpath(os.path.abspath(path))
return path return path
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment