NullUnrestrictedUser __str__ broken

Bug #142563 reported by Bug Importer
0
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Medium
Tres Seaver

Bug Description

AccessControl/User.py, NullUnrestrictedUser - the getUserName method returns a tuple of (None,None). Unfortunately, it derives from BasicUser, which defines __str__ to be getUserName. Thus, when trying to coerce the emergency user when an emergency user doesn't exist, as happens in BasicUserFolder's validate method ("if emergency and user is emergency"), a TypeError is raised, because __str__ doesn't return a string, it returns a tuple.

Either __str__ should be fixed, probably to return str() of getUserName, and/or NullUnrestrictedUser should be set to be false - add a def __len__(self): return 0

Tags: bug zope
Changed in zope2:
status: New → Confirmed
Revision history for this message
Tres Seaver (tseaver) wrote :
Changed in zope2:
assignee: nobody → Tres Seaver (tseaver)
milestone: none → 2.12.6
status: Confirmed → Fix Committed
Tres Seaver (tseaver)
Changed in zope2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.