diff options
author | Marcel Hellkamp <marc@gsites.de> | 2019-12-18 12:05:35 +0100 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2019-12-18 12:05:35 +0100 |
commit | 085f18615fe8ab63588eebfd25bb90337aac2ba0 (patch) | |
tree | 9be21756a8ccbef3a27660010eabc26103e89acd | |
parent | 5c52eb0c0b7f21836375b3584896094735171a9f (diff) | |
download | bottle-085f18615fe8ab63588eebfd25bb90337aac2ba0.tar.gz |
fix #1186: Bottle fails to find templates on windows
os.sep contains a backslash on windows, but os.path.abspath() normalizes
paths to forward slashes. Hard-coding a forward slash on any platform
is actually more correct here.
-rwxr-xr-x | bottle.py | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -2695,8 +2695,7 @@ class ResourceManager(object): res.add_path('./resources/', __file__) """ base = os.path.abspath(os.path.dirname(base or self.base)) - path = os.path.abspath(os.path.join(base, os.path.dirname(path))) - path += os.sep + path = os.path.abspath(os.path.join(base, os.path.dirname(path))) + "/" if path in self.path: self.path.remove(path) if create and not os.path.isdir(path): @@ -3838,7 +3837,7 @@ class BaseTemplate(object): "Refer to templates with names or paths relative to the lookup path.") for spath in lookup: - spath = os.path.abspath(spath) + os.sep + spath = os.path.abspath(spath) + "/" fname = os.path.abspath(os.path.join(spath, name)) if not fname.startswith(spath): continue if os.path.isfile(fname): return fname |