[Python-Dev] Revert #12085 fix for del attribute error message (original) (raw)

Georg Brandl g.brandl at gmx.net
Thu Sep 26 08:53:14 CEST 2013


Am 26.09.2013 08:22, schrieb Nick Coghlan:

On 26 September 2013 15:42, Armin Rigo <arigo at tunes.org> wrote:

Hi Nick,

On Thu, Sep 26, 2013 at 6:59 AM, Nick Coghlan <ncoghlan at gmail.com> wrote: I'm strongly in favour of Georg's one ("Exception in del caught and not propagated").

Such a change is highly unlikely to happen, as it would require changing every location where we call PyErrWriteUnraisable. Er, why? It seems to me it's a matter of changing these three lines in PyErrWriteUnraisable(): - PyFileWriteString("Exception ignored in: ", f); + PyFileWriteString("Exception in ", f); PyFileWriteObject(obj, f, 0); - PyFileWriteString("\n", f); + PyFileWriteString(" caught and not propagated:\n", f); I don't see what makes this technically different from the other solution, "Cannot propagate exception..." Sure, that's doable, but it dumps the full repr of "obj" in the middle of the sentence. The thing that's not practical is the neat and tidy wording Georg proposed, because the thing passed as "obj" is actually an arbitrary Python object that may have a messy repr (like a bound method, which is what gets passed in the del case), so there's definite merit in keeping that repr at the end of the header line.

Then this should be fine, I guess?

Exception caught and not propagated in: <....>

Georg



More information about the Python-Dev mailing list