Browse files

- Fixed an issue with the default renderer not working at certain tim…

…es. See

  #249

Closes #249.
  • Loading branch information...
1 parent 8c900d2 commit 07980e5eed8e632c7b181a343c5b2d256cc04b77 @mcdonc mcdonc committed Aug 10, 2011
Showing with 15 additions and 1 deletion.
  1. +6 −0 CHANGES.txt
  2. +2 −1 pyramid/renderers.py
  3. +7 −0 pyramid/tests/test_renderers.py
View
6 CHANGES.txt
@@ -18,6 +18,12 @@ Backported Features
by the Pyramid router, after which it will be the result of
``sys.exc_info()``.
+Bug Fixes
+---------
+
+- Fixed an issue with the default renderer not working at certain times. See
+ https://github.com/Pylons/pyramid/issues/249
+
1.1 (2011-07-22)
================
View
3 pyramid/renderers.py
@@ -352,7 +352,8 @@ def __init__(self, name=None, package=None, registry=None):
if name and '.' in name:
rtype = os.path.splitext(name)[1]
else:
- rtype = name
+ # important.. must be a string; cannot be None; see issue 249
+ rtype = name or ''
if registry is None:
registry = get_current_registry()
View
7 pyramid/tests/test_renderers.py
@@ -486,6 +486,13 @@ class Dummy(object):
helper = self._makeOne(registry=Dummy)
self.assertEqual(helper.settings, {})
+ def test_settings_registry_name_is_None(self):
+ class Dummy(object):
+ settings = None
+ helper = self._makeOne(registry=Dummy)
+ self.assertEqual(helper.name, None)
+ self.assertEqual(helper.type, '')
+
def test_settings_registry_settings_is_not_None(self):
class Dummy(object):
settings = {'a':1}

0 comments on commit 07980e5

Please sign in to comment.