Skip to content

Commit

Permalink
Use str __name__ for generated simple view classes.
Browse files Browse the repository at this point in the history
This fixes LP #1129030
M
  • Loading branch information
wichert committed Feb 18, 2013
1 parent a955562 commit 5d3a189
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
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.
This is added for compatibility with ``zope.pagetemplate`` 4.0.0.
The argument is ignored (LP #732972).
Expand Down
3 changes: 2 additions & 1 deletion src/Products/Five/browser/metaconfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def page(_context, name, permission, for_=Interface,
allowed_interface=None, allowed_attributes=None,
attribute='__call__', menu=None, title=None,
):
name = str(name) # De-unicode
_handle_menu(_context, menu, title, [for_], name, permission, layer)
required = {}

Expand Down Expand Up @@ -452,7 +453,7 @@ def __getitem__(self, name):


# 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:
offering = sys._getframe(1).f_globals

Expand Down

0 comments on commit 5d3a189

Please sign in to comment.