summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2012-03-26 17:58:06 -0400
committerChris McDonough <chrism@plope.com>2012-03-26 17:58:06 -0400
commit4f97b61c425b620ffca190f130625c84c5754475 (patch)
treee941d88049043edf7d41815fb2a8a3ae8e6181a4
parentae5ab35c2bc9ceebbd2b52d490e1808c016bf086 (diff)
downloadpyramid-4f97b61c425b620ffca190f130625c84c5754475.tar.gz
pyramid-4f97b61c425b620ffca190f130625c84c5754475.tar.bz2
pyramid-4f97b61c425b620ffca190f130625c84c5754475.zip
speculative fix for issue #512
-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)