Don't sanitize local paths using posixpath

This doesn't work as expected on Windows.
This commit is contained in:
Unrud 2016-05-21 01:41:00 +02:00
parent 8e09c0b315
commit b810d61ce3

View File

@ -97,7 +97,6 @@ def path_to_filesystem(root, *paths):
Conversion is done in a secure manner, or raises ``ValueError``. Conversion is done in a secure manner, or raises ``ValueError``.
""" """
root = sanitize_path(root)
paths = [sanitize_path(path).strip("/") for path in paths] paths = [sanitize_path(path).strip("/") for path in paths]
safe_path = root safe_path = root
for path in paths: for path in paths:
@ -303,7 +302,7 @@ class Collection(BaseCollection):
_, directories, _ = next(os.walk(collection._filesystem_path)) _, directories, _ = next(os.walk(collection._filesystem_path))
for sub_path in directories: for sub_path in directories:
full_path = os.path.join(collection._filesystem_path, sub_path) full_path = os.path.join(collection._filesystem_path, sub_path)
if os.path.exists(path_to_filesystem(full_path)): if os.path.exists(full_path):
yield cls(posixpath.join(path, sub_path)) yield cls(posixpath.join(path, sub_path))
@classmethod @classmethod