summaryrefslogtreecommitdiff
path: root/repoze/bfg/traversal.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-02-16 22:17:42 +0000
committerChris McDonough <chrism@agendaless.com>2009-02-16 22:17:42 +0000
commitb1de627f08e4504a804a49cecacfdd306217f908 (patch)
tree4b17aec2e4577705678d7494a0eac7b9c2aaa319 /repoze/bfg/traversal.py
parent42dd67d04c17a87bebd94bc7d8faca8ea1da9ac0 (diff)
downloadpyramid-b1de627f08e4504a804a49cecacfdd306217f908.tar.gz
pyramid-b1de627f08e4504a804a49cecacfdd306217f908.tar.bz2
pyramid-b1de627f08e4504a804a49cecacfdd306217f908.zip
- Using ``model_url`` or ``model_path`` against a broken model graph
(one with models that had a non-root model with a ``__name__`` of ``None``) caused an inscrutable error to be thrown: ( if not ``_must_quote[cachekey].search(s): TypeError: expected string or buffer``). Now URLs and paths generated against graphs that have None names in intermediate nodes will replace the None with the empty string, and, as a result, the error won't be raised. Of course the URL or path will still be bogus.
Diffstat (limited to 'repoze/bfg/traversal.py')
-rw-r--r--repoze/bfg/traversal.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/repoze/bfg/traversal.py b/repoze/bfg/traversal.py
index 02b6589ac..47ac5fa7f 100644
--- a/repoze/bfg/traversal.py
+++ b/repoze/bfg/traversal.py
@@ -213,7 +213,7 @@ def model_path_tuple(model, *elements):
def _model_path_list(model, *elements):
""" Implementation detail shared by model_path and model_path_tuple """
lpath = reversed(list(lineage(model))[:-1])
- path = [ location.__name__ for location in lpath ]
+ path = [ location.__name__ or '' for location in lpath ]
if elements:
path = path + list(elements)