Commit 5d3a1897 authored by Wichert Akkerman's avatar Wichert Akkerman

Use str __name__ for generated simple view classes.

This fixes LP #1129030
M
parent a955562e
...@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/. ...@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed Bugs Fixed
++++++++++ ++++++++++
- Make sure the generated classes for simple browser pages (SimpleViewClasses)
have a str __name__. See LP #1129030.
- In ``PageTemplate.pt_errors`` accept the ``check_macro_expansion`` argument. - In ``PageTemplate.pt_errors`` accept the ``check_macro_expansion`` argument.
This is added for compatibility with ``zope.pagetemplate`` 4.0.0. This is added for compatibility with ``zope.pagetemplate`` 4.0.0.
The argument is ignored (LP #732972). The argument is ignored (LP #732972).
......
...@@ -92,6 +92,7 @@ def page(_context, name, permission, for_=Interface, ...@@ -92,6 +92,7 @@ def page(_context, name, permission, for_=Interface,
allowed_interface=None, allowed_attributes=None, allowed_interface=None, allowed_attributes=None,
attribute='__call__', menu=None, title=None, attribute='__call__', menu=None, title=None,
): ):
name = str(name) # De-unicode
_handle_menu(_context, menu, title, [for_], name, permission, layer) _handle_menu(_context, menu, title, [for_], name, permission, layer)
required = {} required = {}
...@@ -452,7 +453,7 @@ class ViewMixinForTemplates(zope.browserpage.simpleviewclass.simple): ...@@ -452,7 +453,7 @@ class ViewMixinForTemplates(zope.browserpage.simpleviewclass.simple):
# Original version: zope.browserpage.simpleviewclass.SimpleViewClass # Original version: zope.browserpage.simpleviewclass.SimpleViewClass
def SimpleViewClass(src, offering=None, used_for=None, bases=(), name=u''): def SimpleViewClass(src, offering=None, used_for=None, bases=(), name=''):
if offering is None: if offering is None:
offering = sys._getframe(1).f_globals offering = sys._getframe(1).f_globals
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment