curl-and-python

pycurl`s curl.Curl interface wrong behaviour

From: Cepгей А via curl-and-python <curl-and-python_at_cool.haxx.se>
Date: Mon, 19 Sep 2016 16:04:51 +0300

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
Received on 2016-09-19