monkey patching 'debug' breaks twisted.internet.base.DelayedCall

Bug #684071 reported by Jelmer Vernooij
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Twisted
New
Undecided
Unassigned
testtools
Triaged
Medium
Unassigned

Bug Description

 affects testtools

twisted.internet.base.DelayedCall has different behaviour depending
whether or not debug was specified to its constructor. It will set
self.creator to traceback.format_stack().

Later on, in its __str__ it uses the debug attribute to determine
whether or not to add a traceback to the output - a traceback which is
not available in case testtools monkey patched debug to be true.

Btw, apart from this issue the debug code was really useful in tracking
down a bug in the builddmanager yesterday. Thanks for writing it.

Cheers,

jelmer

Tags: twisted
Revision history for this message
Jonathan Lange (jml) wrote :

I don't understand this bug. In particular, it's not clear how monkey-patching debug breaks DelayedCall.

It sounds like it might be an issue with DelayedCall itself?

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

So, if I understand correctly, the main issue is a bug in twisted, namely that DelayedCall doesn't deal well with its "debug" attribute "changing" after it has been created?

Revision history for this message
Jonathan Lange (jml) wrote :

That seems right to me. testtools probably should work around Twisted, and we should probably fix upstream as soon as we can.

Jonathan Lange (jml)
Changed in testtools:
status: New → Triaged
importance: Undecided → Low
importance: Low → High
importance: High → Undecided
Revision history for this message
Jonathan Lange (jml) wrote :

This is serious enough that I would like to fix it before adding any features.

 importance: High

Changed in testtools:
importance: Undecided → High
Changed in testtools:
importance: High → Medium
Jonathan Lange (jml)
tags: added: twisted
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.