summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwillmcgugan@gmail.com <willmcgugan@gmail.com@67cdc799-7952-0410-af00-57a81ceafa0f>2012-11-28 18:32:58 +0000
committerwillmcgugan@gmail.com <willmcgugan@gmail.com@67cdc799-7952-0410-af00-57a81ceafa0f>2012-11-28 18:32:58 +0000
commit4f61ee77b1b4acb9d471246b76cea639acff800f (patch)
treeb6e36ff19bd10f0a5ee9f7c1c71381999278d643
parentb39b373f5c38fd5d7a058c879e433dbd3128abbc (diff)
downloadpyfilesystem-4f61ee77b1b4acb9d471246b76cea639acff800f.tar.gz
Fix for invalid chars in path on win32
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@832 67cdc799-7952-0410-af00-57a81ceafa0f
-rw-r--r--fs/osfs/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/osfs/__init__.py b/fs/osfs/__init__.py
index a6f0a3a..4202784 100644
--- a/fs/osfs/__init__.py
+++ b/fs/osfs/__init__.py
@@ -88,7 +88,7 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
}
if sys.platform == 'win32':
- _invalid_path_chars = '\\:*?"<>|'
+ _invalid_path_chars = ''.join(char(n) for n in xrange(31)) + '\\:*?"<>|'
else:
_invalid_path_chars = '\0'
_re_invalid_path_chars = re.compile('|'.join(re.escape(c) for c in _invalid_path_chars), re.UNICODE)
@@ -159,12 +159,12 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
raise InvalidCharsInPathError(path)
def getsyspath(self, path, allow_none=False):
- path = relpath(normpath(path)).replace("/", os.sep)
+ self._validate_path(path)
+ path = relpath(normpath(path)).replace(u"/", os.sep)
path = os.path.join(self.root_path, path)
if not path.startswith(self.root_path):
raise PathError(path, msg="OSFS given path outside root: %(path)s")
path = self._decode_path(path)
- self._validate_path(path)
return path
def unsyspath(self, path):