Explorar o código

Turn backslashes into slashes on Windows (fixes #581)

Guillaume Ayoub %!s(int64=14) %!d(string=hai) anos
pai
achega
160e296ed1
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      radicale/ical.py

+ 2 - 1
radicale/ical.py

@@ -196,7 +196,8 @@ class Calendar(object):
 
         """
         # First do normpath and then strip, to prevent access to FOLDER/../
-        attributes = posixpath.normpath(path).strip("/").split("/")
+        sane_path = posixpath.normpath(path.replace(os.sep, "/")).strip("/")
+        attributes = sane_path.split("/")
         if not attributes:
             return None
         if not (os.path.isfile(os.path.join(FOLDER, *attributes)) or