소스 검색

Turn backslashes into slashes on Windows (fixes #581)

Guillaume Ayoub 14 년 전
부모
커밋
160e296ed1
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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