[Zope] Parsed xml problems

Peter Millar peter.millar at parasyn.com.au
Thu Jul 15 02:32:06 EDT 2004


I am using parsed xml . I have a parsed xml file in a folder.  

I tried to lockdown my plone site, by following the link in
http://plone.org/documentation/howto/HowToCreateAPrivatePloneSite
This works great ( basically set a whole bunch of workflow state
permissions to authenticated then run the update security settings) if
you don't have a parsed xml file inside your site, but if you do you get
a nastly little error 

TypeError: hasattr expected 2 arguments, got 1

The even.log file says:
2004-07-15T16:12:32 ERROR(200) SiteError
http://localhost:5555/nerwa/portal_workflow/updateRoleMappings
Traceback (most recent call last):
  File "C:\plone\Plone\Zope\lib\python\ZPublisher\Publish.py", line 100,
in publish
    request, bind=1)
  File "C:\plone\Plone\Zope\lib\python\ZPublisher\mapply.py", line 88,
in mapply
    if debug is not None: return debug(object,args,context)
  File "C:\plone\Plone\Zope\lib\python\ZPublisher\Publish.py", line 40,
in call_object
    result=apply(object,args) # Type s<cr> to step into published
object.
  File "C:\plone\Plone\Data\Products\CMFCore\WorkflowTool.py", line 490,
in updateRoleMappings
    count = self._recursiveUpdateRoleMappings(portal, wfs)
  File "C:\plone\Plone\Data\Products\CMFCore\WorkflowTool.py", line 673,
in _recursiveUpdateRoleMappings
    count = count + self._recursiveUpdateRoleMappings(v, wfs)
  File "C:\plone\Plone\Data\Products\CMFCore\WorkflowTool.py", line 673,
in _recursiveUpdateRoleMappings
    count = count + self._recursiveUpdateRoleMappings(v, wfs)
  File "C:\plone\Plone\Data\Products\CMFCore\WorkflowTool.py", line 673,
in _recursiveUpdateRoleMappings
    count = count + self._recursiveUpdateRoleMappings(v, wfs)
  File "C:\plone\Plone\Data\Products\CMFCore\WorkflowTool.py", line 669,
in _recursiveUpdateRoleMappings
    obs = ob.objectItems()
  File "C:\plone\Plone\Zope\lib\python\Products\ParsedXML\ParsedXML.py",
line 283, in objectItems
    return ManageableDocument.objectItems(self, spec)
  File
"C:\plone\Plone\Zope\lib\python\Products\ParsedXML\ManageableDOM.py",
line 241, in objectItems
    for ob in self.objectValues(spec): a((ob.getId(), ob))
  File
"C:\plone\Plone\Zope\lib\python\Products\ParsedXML\ManageableDOM.py",
line 193, in getId
    if hasattr(self.aq_base):
TypeError: hasattr expected 2 arguments, got 1

I found the problem on line 193 it says :

    # partial ObjectManagerItem interface

    def getId(self):
        "Return the id of the object as a string."
        if hasattr(self.aq_base):
            base = self.aq_base
        else:
            base = self
        name=getattr(base, 'id', None)
        if name is not None:
            return name
        return self.tpURL()

You can see straightaway that someone is using hasattr with only one
parameter.  Not good is it.

Any suggestions how to fix.  The work around I have is just to remove my
xml file, apply the security then put the xml file back . although this
works it is not the ideal solution.

Maybe I shouldn't be using parsed xml maybe there is a better python xml
parser out there??

____________________________________________ 
Peter Millar 
Technical Project Manager 
Parasyn Controls Pty Ltd 

Peter.Millar at Parasyn.com.au 
T: 61 7 3396 6388 
F: 61 7 3396 6299 
45 Millenium Place, Tingalpa QLD 4173 
PO Box 400 Cannon Hill QLD 4170 
Australia 
www.parasyn.com.au <http://www.parasyn.com.au/>  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20040715/30c1c3c2/attachment.htm


More information about the Zope mailing list