Opened 15 years ago
Last modified 15 years ago
#130 new defect
problems in CopiedFailure
Reported by: | Brian Warner | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | undecided |
Component: | error-handling | Version: | 0.4.1 |
Keywords: | Cc: |
Description
While trying to debug a remote exception (which turned out to be in remote_decref, being called on a CLID which had already gone away), I was frustrated to see that the trial output was an extremely terse [ERROR] "KeyError: 1"
. Asking trial for more detail (by passing it --tbformat=verbose
provoked an internal trial error, no attribute ".count" while trying to do printTraceback.
There are several overlapping problems:
- Twisted's
Failure
object has acquired some new attributes in recent versions. In particular, each Failure instance gets a unique .count attribute, assigned in the constructor, andFailure.printTraceback
will include it in the rendered traceback if tbformat==verbose. Foolscap was not sending a copy of .count over the wire. - the receiving process is getting an actual Failure instance, rather than a
CopiedFailure
instance. In particular,Failure.printTraceback
is being called instead ofCopiedFailure.printTraceback
, so the lack of .count is more troublesome. I don't understand why this could be the case. I think what we do is instantiate a CopiedFailure and then set its__dict__
to the deserialized attribute dictionary. Perhaps that__dict__
set also manages to set__class__
and thus changes the method lookup behavior. But__class__
isn't supposed to be part of the attribute dictionary that is sent over the wire. - if
CopiedFailure
could produce a .frames attribute that looked more like whatFailure
was expecting, this wouldn't be such a problem.
Attachments (1)
Change History (3)
comment:1 Changed 15 years ago by
Changed 15 years ago by
Attachment: | send-count.diff added |
---|
patch to include .count attribute in CopiedFailure? dict
comment:2 Changed 15 years ago by
Component: | unknown → error-handling |
---|
Note: See
TracTickets for help on using
tickets.
note that modifying
twisted.trial.reporter.Reporter._formatFailureTraceback
to printfail.traceback
will display the missing debug information.CopiedFailure.printTraceback
does this, but it's not getting called (insteadFailure.printTraceback
is called, which tries to render .frames instead of .traceback, and CopiedFailures don't have .frames).