From ab429edc94e3d6db26ff398672c716982a5d64c0 Mon Sep 17 00:00:00 2001 From: Jason Madden Date: Thu, 30 Nov 2017 11:47:28 -0600 Subject: Fix default values for Permission's title and description in Py2 And test this. This applies to both the class and the ZCML directive. Also adjust IPermission to use NativeStringLine for ``id``, since that's what ZCML has always been creating (it uses an Id, which subclasses NativeStringLine), and what's typically written in source code. Test that the permissions created from ZCML are valid with this change. --- src/zope/security/zcml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/zope/security/zcml.py') diff --git a/src/zope/security/zcml.py b/src/zope/security/zcml.py index 78ef5cc..52bcf91 100644 --- a/src/zope/security/zcml.py +++ b/src/zope/security/zcml.py @@ -89,7 +89,7 @@ class IPermissionDirective(Interface): description=u"Provides a description for the object.", required=False) -def permission(_context, id, title, description=''): +def permission(_context, id, title, description=u''): from zope.security.interfaces import IPermission from zope.security.permission import Permission from zope.component.zcml import utility -- cgit v1.2.1