[Zope] Reverse-resolve hex instance numbers in traceback?

Dylan Reinhardt zope at dylanreinhardt.com
Tue Oct 7 11:06:46 EDT 2003


On Tue, 2003-10-07 at 02:30, Milos Prudek wrote:
> The error appeared in line 3, in writer_1_row script. But that script is 
> OK. The problem is caused by a specific ZClass instance which lacks the 
> expected attribute.
> 
> Is it possible to reverse-resolve hex instance numbers in the traceback 
> to find out which instance it is?

Sure... you *can* get the address of an object by getting the string
representation of it using backticks, ex:

`my_obj`

A better way might be something some Python like this:

-----------
for obj in container.objectValues(my_obj_type)
    if hasattr(obj, attribute_name):
      print obj['id']
return printed
-----------

That would give you a list of *all* the objects that lack the specific
attribute, not just the one that you think you're looking for.

HTH,

Dylan




More information about the Zope mailing list