1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-07-08 17:08:30 +00:00

Turn backslashes into slashes on Windows (fixes #581)

This commit is contained in:
Guillaume Ayoub 2011-09-25 19:41:24 +02:00
parent 2cac01a217
commit 53a9d92dc2

View file

@ -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