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

THRIFT-5467 Python: fix CannotSendHeader exception #2491

Merged

Conversation

csordasmarton
Copy link
Contributor

Based on the python source for http.client, HTTPConnection.putheader
can only be called after a request has been started, and before it's
been sent. Otherwise it will throw a http.client.CannotSendHeader
exception.

If the server returns a Set-Cookie header, the client will always
fail with the CannotSendHeader exception because HTTPConnection.putheader
is called after reading the response.

With this patch we will call this method before the request has been sent.

@csordasmarton
Copy link
Contributor Author

Is there anything I can do to get this merged?

@Jens-G
Copy link
Member

Jens-G commented Feb 17, 2022

There's some strange message in the logs ... could you force-push to trigger CI again?

Based on the python source for `http.client`, `HTTPConnection.putheader`
can only be called after a request has been started, and before it's
been sent. Otherwise it will throw a `http.client.CannotSendHeader`
exception.

If the server returns a `Set-Cookie` header, the client will always
fail with the `CannotSendHeader` exception because `HTTPConnection.putheader`
is called after reading the response.

With this patch we will call this method before the request has been sent.
@csordasmarton csordasmarton force-pushed the fix_python_http_client_save_cookie branch from 2f62d38 to be39e06 Compare February 21, 2022 13:22
@csordasmarton
Copy link
Contributor Author

@Jens-G Done. I also rebased my branch.

@Jens-G Jens-G merged commit 103a11c into apache:master Feb 21, 2022
@rajatm91
Copy link

rajatm91 commented May 4, 2022

I see in the Jira that this issue is fixed as part of v0.17.0. What are the timelines for to release of this version?

@johnjiang
Copy link

johnjiang commented May 4, 2023

@Jens-G, can we get this released to pypi?

@trams
Copy link

trams commented Aug 2, 2023

@jeking3 is another maintainer. @jeking3 , can you help us to release 0.17 to PyPi? thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants