Re: [Twisted-Python] understanding twisted, better error handling

2017-01-10 Thread Tristan Seligmann
On Wed, 11 Jan 2017 at 02:26 steven meiers  wrote:

> True, but since python 2.x is still shipped with debian testing for
> example there will be some people running into this issue.
> Just to make twisted more approachable this could he handled.
>

The b'GET' syntax for byte strings works on Python 2.7 (you get a str) as
well as Python 3, so I would suggest we use it everywhere in the
documentation / examples to make it easier on programmers using both Python
2 and 3.
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


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

2017-01-10 Thread Tom Most
On 01/08/2017 06:49 PM, Glyph Lefkowitz wrote:
>
>> On Jan 6, 2017, at 11:03 AM, steven meiers > > wrote:
>>
>> 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.
>
> Something that we discussed on IRC but did not come up in the mailing
> list thread may be the one issue that *should* be fixed in treq:
>
> Because of this issue, this example
> - http://treq.readthedocs.io/en/latest/#post - which the OP was
> following, doesn't work on Python 3.
>
> We should fix the docs so that it does.

I submitted a PR to fix this a while ago:
https://github.com/twisted/treq/pull/152

Also, the docs on RTD are still out of date. Who owns them? I'd be happy
to help.

---Tom
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] understanding twisted, better error handling

2017-01-10 Thread steven meiers
Am Montag, den 09.01.2017, 23:12 -0800 schrieb Glyph Lefkowitz:
> 
> 
> > On Jan 9, 2017, at 5:20 PM, steven meiers 
> > wrote:
> > 
> > the error does come up when you give agent.request a "GET" instead
> > of a
> > b"GET".
> 
> That's expected; you do have to pass the method as `bytes`, as
> documented here: https://twistedmatrix.com/documents/16.6.0/api/twist
> ed.web.iweb.IAgent.html#request
> 
> 

True, but since python 2.x is still shipped with debian testing for
example there will be some people running into this issue.
Just to make twisted more approachable this could he handled.

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python