[Twisted-Python] treq POST abborting with: err: ('Could not adapt', '{"....", "..."} <InterfaceClass twisted.web.iweb.IBodyProducer>)

Tristan Seligmann mithrandi at mithrandi.net
Fri Jan 6 19:14:14 MST 2017


On Sat, 7 Jan 2017 at 03:23 Glyph Lefkowitz <glyph at twistedmatrix.com> wrote:

>
> Even if we do this though - is there any way to convince json.dumps to
> behave consistently between 2/3 for the purposes of examples?
>

As far as I know, the only way to handle this is with an if PY3 or if
isinstance(…). I don't know of a way to make json.dumps on Python 2
consistently return unicode, and I don't know of a way to make json.dumps
on Python 3 return bytes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20170107/063a59a2/attachment-0002.html>


More information about the Twisted-Python mailing list