ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> zope-checkins
zope-checkins
[Zope-Checkins] SVN: Zope/branches/2.12/ LP #411732: Silence security declaration warnings for context and request on views protected by an interface.
by Hanno Schlichting other posts by this author
Oct 31 2009 4:03AM messages near this date
[Zope-Checkins] SVN: Zope/trunk/src/App/class_init.py Merged c105405 from 2.12 branch | [Zope-Checkins] SVN: Zope/branches/2.12/ Update to setuptools = 0.6c11
Log message for revision 105405:
  LP #411732: Silence security declaration warnings for context and request on views protect
ed by an interface.
  

Changed:
  U   Zope/branches/2.12/doc/CHANGES.rst
  U   Zope/branches/2.12/src/App/class_init.py

-=-
Modified: Zope/branches/2.12/doc/CHANGES.rst
===================================================================
--- Zope/branches/2.12/doc/CHANGES.rst	2009-10-31 10:56:36 UTC (rev 105404)
+++ Zope/branches/2.12/doc/CHANGES.rst	2009-10-31 11:03:24 UTC (rev 105405)
@@ -17,6 +17,9 @@
   - Acquisition = 2.12.4 (fixes problems with iteration support)
   - setuptools = 0.6c11
 
+- LP #411732: Silence security declaration warnings for context and request
+  on views protected by an interface.
+
 - Assorted documentation cleanups, including a script to rebuild HTML
   documentation on Windows.
 

Modified: Zope/branches/2.12/src/App/class_init.py
===================================================================
--- Zope/branches/2.12/src/App/class_init.py	2009-10-31 10:56:36 UTC (rev 105404)
+++ Zope/branches/2.12/src/App/class_init.py	2009-10-31 11:03:24 UTC (rev 105405)
@@ -77,7 +77,10 @@
                 pr = PermissionRole(pname)
             for mname in mnames:
                 setattr(self, mname+'__roles__', pr)
-                if mname and not hasattr(self, mname):
+                if (mname and mname not in ('context', 'request') and
+                    not hasattr(self, mname)):
+                    # don't complain about context or request, as they are
+                    # frequently not available as class attributes
                     logging.getLogger("Init").warning(
                         "Class %s.%s has a security declaration for "
                         "nonexistent method %r", self.__module__,

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@[...].org
https://mail.zope.org/mailman/listinfo/zope-checkins

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved