Hi everybody!

I'm trying to defrost the ticket #16245 that says that
`django.dispatch.dispatcher.Signal.send_robust` should include not only the
exception but also the traceback if something goes wrong.

At this moment, `send_robust` returns a list of (receiver, exception) tuples so
that...

    for receiver, exc in my_signal.send_robust():
        ...

Now, this ticket doubts between two possible solutions. The first of them is
returning a `(receiver, (type, exception, traceback))` made by
`(receiver, sys.exc_info())` tuple if `exc_info` is True:

    for receiver, (typ, exc, tbk) in my_signal.send_robust(exc_info=True):
        ...

The second solution is to attach the traceback to the exception, a la Python 3,
at its `__traceback__` attribute.

The two solutions are backwards compatible. Personally, I prefer the second one
because it's the way to go on Python 3, it doesn't add extra parameters for
maintaining backwards compatibility and doesn't return a messy list of tuple
of tuples.

But there's already a patch with tests from two years ago implementing solution
#1. So what do you think? Do I try to recover the patch with the first solution
or do I go with the second one?

Yours sincerely,
Unai

Attachment: signature.asc
Description: PGP signature

Reply via email to