Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reuse curl.Curl objects. #411

Closed
dimaqq opened this issue Sep 20, 2016 · 3 comments
Closed

reuse curl.Curl objects. #411

dimaqq opened this issue Sep 20, 2016 · 3 comments

Comments

@dimaqq
Copy link
Contributor

dimaqq commented Sep 20, 2016

Cepгей А sergb95@list.ru reports:

There is a bug in pycurls 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.Curls internal StringIO buffer. It can be fixed by adding these two lines to curl.Curls __request function:

  self.payload_io.seek(0)
  self.payload_io.truncate()
@dimaqq
Copy link
Contributor Author

dimaqq commented Sep 20, 2016

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}.

@p
Copy link
Member

p commented Sep 21, 2016

Sounds like a bug, thanks!

p added a commit that referenced this issue Dec 1, 2016
@p
Copy link
Member

p commented Dec 1, 2016

This is now fixed in master.

@p p closed this as completed Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants