curl-and-python
Re: pycurl`s curl.Curl interface wrong behaviour
Date: Mon, 19 Sep 2016 15:32:56 +0200
Indeed, it looks like `Curl` is designed to be a throw-away object.
If it were intended for reuse, I'd expect to see all the default
settings in own method, which is called from {init, get, post}.
On 19 September 2016 at 15:04, Cepгей А via curl-and-python
<curl-and-python_at_cool.haxx.se> wrote:
> Hello,
> There is a bug in pycurl`s curl module. When using
> curl.Curl requests subsequently, curl.Curl.__request returns the current
> request` body, inculing the previous bodies. The cause is about wrong
> handling of curl.Curl`s internal StringIO buffer. It can be fixed by
> adding these two lines to curl.Curl`s __request function:
>
> self.payload_io.seek(0)
> self.payload_io.truncate()
>
> I`m running Python 2.7 ,PycURL/7.43.0 libcurl/7.50.1 on Debian Sid.
>
> _______________________________________________
> https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
_______________________________________________
https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2016-09-19