From b1de627f08e4504a804a49cecacfdd306217f908 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 16 Feb 2009 22:17:42 +0000 Subject: - 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. --- repoze/bfg/traversal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'repoze/bfg/traversal.py') 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) -- cgit v1.2.3