Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Hard to tell what went wrong when a text content object is broken #111
Comments
thomir
self-assigned this
Oct 16, 2014
|
So you're suggesting earlier, stricter type checking in |
|
@jml I was suggesting that, but @rbtcollins didn't like the whack-a-mole approach here - i.e.- we keep finding these places, and keep having to patch testtools. AIUI, he's suggesting making testtools tracebacks print frame locals, which might at least give us the information we need. There's a long thread on the TIP ML you may have seen... I'd still like to fix this sooner rather than later. I'm wondering if I can convince @rbtcollins to accept a specific fix as well. Thoughts? |
|
I won't push back against a tasteful specific fix. I just am not sure that there is one that won't actually be a net negative. Re-raising needs to be done carefully with 3.x because of chaining. |
added a commit
to rbtcollins/testtools
that referenced
this issue
Mar 9, 2015
added a commit
to rbtcollins/testtools
that referenced
this issue
Mar 9, 2015
added a commit
to rbtcollins/testtools
that referenced
this issue
Mar 9, 2015
|
Fixed IMO - run with --locals, should be pretty clear. |
thomir commentedOct 16, 2014
I see lots of stack traces such as this one:
... where testtools attempts to convert a content object to a string, only to find that even though the content type of the content object is 'text', the content object returns something other than text.
This has been partially fixed in a separate PR that makes the text_content function more picky about what it accepts, but I think we should also catch the raised exception, and re-raise with the name of the content object being processed.