summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pyramid/mako_templating.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pyramid/mako_templating.py b/pyramid/mako_templating.py
index b2db28ba7..c4c12f02a 100644
--- a/pyramid/mako_templating.py
+++ b/pyramid/mako_templating.py
@@ -33,7 +33,9 @@ class PkgResourceTemplateLookup(TemplateLookup):
"""Called from within a Mako template, avoids adjusting the
uri if it looks like an asset specification"""
# Don't adjust asset spec names
- if ':' in uri:
+ isabs = os.path.isabs(uri)
+ if (not isabs) and (':' in uri):
+ # fbo asset specs on windows: cant have colons in filename
return uri
return TemplateLookup.adjust_uri(self, uri, relativeto)
@@ -48,16 +50,17 @@ class PkgResourceTemplateLookup(TemplateLookup):
"""
isabs = os.path.isabs(uri)
if (not isabs) and (':' in uri):
+ adjusted = uri.replace(':', '_')
try:
if self.filesystem_checks:
- return self._check(uri, self._collection[uri])
+ return self._check(adjusted, self._collection[adjusted])
else:
- return self._collection[uri]
+ return self._collection[adjusted]
except KeyError:
pname, path = resolve_asset_spec(uri)
srcfile = abspath_from_asset_spec(path, pname)
if os.path.isfile(srcfile):
- return self._load(srcfile, uri)
+ return self._load(srcfile, adjusted)
raise exceptions.TopLevelLookupException(
"Can not locate template for uri %r" % uri)
return TemplateLookup.get_template(self, uri)