[Twisted-Python] treq POST abborting with: err: ('Could not adapt', '{"....", "..."} )

2017-01-06 Thread steven meiers
hi, sending a simple post request with a body (cookies) results in a error here. im using python 3.x with the latest twisted and treq installed via pip in a virtualenv. the code gets a chatroom login page, extracts two values, gets the cookies and logs a user into the chat. (incomplete) thing

[Twisted-Python] treq POST abborting with: err: ('Could not adapt', '{"....", "..."} )

2017-01-06 Thread steven meiers
hi, sending a simple post request with a body (cookies) results in a error here. im using python 3.x with the latest twisted and treq installed via pip in a virtualenv. the code gets a chatroom login page, extracts two values, gets the cookies and logs a user into the chat. (incomplete) thing

Re: [Twisted-Python] treq POST abborting with: err: ('Could not adapt', '{"....", "..."} )

2017-01-06 Thread Tristan Seligmann
On Fri, 6 Jan 2017 at 21:21 steven meiers wrote: > glyph (without seeing the the code or backtrace) suggested that: > "I think the issue might be that it doesn't support bytes() on py3, > it's registered against str() or something" > Actually, the problem is the reverse of this; only bytes is su

Re: [Twisted-Python] treq POST abborting with: err: ('Could not adapt', '{"....", "..."} )

2017-01-06 Thread Glyph Lefkowitz
1 > On Jan 6, 2017, at 3:36 PM, Tristan Seligmann wrote: > > On Fri, 6 Jan 2017 at 21:21 steven meiers > wrote: > glyph (without seeing the the code or backtrace) suggested that: > "I think the issue might be that it doesn't support bytes() on py3, > it's registere

Re: [Twisted-Python] treq POST abborting with: err: ('Could not adapt', '{"....", "..."} )

2017-01-06 Thread Tristan Seligmann
On Sat, 7 Jan 2017 at 03:23 Glyph Lefkowitz 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 w

Re: [Twisted-Python] treq POST abborting with: err: ('Could not adapt', '{"....", "..."} )

2017-01-06 Thread Tristan Seligmann
On Sat, 7 Jan 2017 at 03:23 Glyph Lefkowitz wrote: > > Maybe we should support unicode for the body as well. We can set the > charset in the mime-type and everything so that it will be properly > intelligible by the server, which doesn't happen if the user manually > encodes like this. > Oh, fo