diff options
| author | Gabi Davar <grizzly.nyo@gmail.com> | 2015-08-27 17:07:48 +0300 |
|---|---|---|
| committer | Gabi Davar <grizzly.nyo@gmail.com> | 2015-08-27 17:35:01 +0300 |
| commit | 363f21046ece217bc663db083f01829bd074fb48 (patch) | |
| tree | d0e93c075f14f2951ef16f430e0c2c9523cd3ff5 /mako | |
| parent | 1de5a335f4a96b0eedd801b5d885a2592735a497 (diff) | |
| download | external_python_mako-363f21046ece217bc663db083f01829bd074fb48.tar.gz external_python_mako-363f21046ece217bc663db083f01829bd074fb48.tar.bz2 external_python_mako-363f21046ece217bc663db083f01829bd074fb48.zip | |
correct template lookup on Windows:
- posixpath.join does not handle windows paths very well.
Now all tests pass on py27 & py34 on windows.
Diffstat (limited to 'mako')
| -rw-r--r-- | mako/lookup.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mako/lookup.py b/mako/lookup.py index 794d853..e6dff9d 100644 --- a/mako/lookup.py +++ b/mako/lookup.py @@ -248,6 +248,9 @@ class TemplateLookup(TemplateCollection): except KeyError: u = re.sub(r'^\/+', '', uri) for dir in self.directories: + # make sure the path seperators are posix - os.altsep is empty + # on POSIX and cannot be used. + dir = dir.replace(os.path.sep, posixpath.sep) srcfile = posixpath.normpath(posixpath.join(dir, u)) if os.path.isfile(srcfile): return self._load(srcfile, uri) |
