-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
bug report #1397
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
Comments
We've seen this before, here. The short of it is that the remote server is claiming that the data is chunked, but it isn't. |
@Lukasa Perhaps requests could wrap the exception and display that? |
It's possible. I'd need to reread the httplib code and confirm that we can't raise IncompleteRead for any other reason though. |
We should be able to work around this, I think. |
This is causing issues and is being masked by an SSL error. I'm 90% certain it is the cause of this: https://twitter.com/bkmontgomery/status/351090132004257792 |
I don't think I have a good picture in my head of how we can get httplib to do the correct read here, when the server is sending incorrect headers. |
output
All the servers are running I suspect this problem is related to specific ASP.Net version. If we can find a site with same issue with different |
Interesting! This is some awesome detective work @kracekumar! Does look like a very specific bug here, but I'm still not convinced we can neatly work our way around it. |
So, we can't work around this, at least not on all platforms. Here's the relevant code from httplib in our supported versions of Python 2.X: try:
chunk_left = int(line, 16)
except ValueError:
# close the connection as protocol synchronisation is
# probably lost
self.close()
raise IncompleteRead(''.join(value)) At the point the exception is raised the connection has been closed. Additionally, the read data is thrown away, so we can't pull it out. Working around this would require patching the standard library or using a forked version of httplib in urllib3. It looks like our best shot is actually just to wrap this exception: maybe a |
Mitigated by #1498. |
Dear Kenneth Reitz,
I use your Requests library which is quite cool. I ran into some issues like httplib uncaught exceptions
which (i think) should be handled by Requests.
Consider the following code:
import requests
r = requests.get('http://www.bilhetos.com')
It raises 'httplib.IncompleteRead' exception which is not handled properly in Requests.
Please consider urls below for testing:
http://www.tusseymountaintitans.com
http://www.abbottpanthers.com
http://www.spanishmoms.com
http://www.long-island-storage.com
http://www.cupertinohelpwanted.com
http://www.hoffmanestateshawks.com
http://www.brothermartincrusaders.com
http://www.1-800-printer.com
http://www.impiretickets.com
http://www.gdickinson.com
http://www.forensicsline.com
http://www.gardeningtime.com
http://www.ecollegetennis.com
http://www.milacasaints.com
http://www.bartoninsuranceagency.com
http://www.djnatural.com
http://www.containers2000.com
http://www.indiancreektimberwolves.com
http://www.athenswarriors.com
http://www.logansportcats.com
http://www.osani.com
http://www.xn--sammler-brse-djb.com
http://www.800usahealth.com
http://www.wealth-wise.com
http://www.foothillmustangs.com
http://www.manasquanbigblue.com
http://www.bilhetos.com
http://www.atlantahomesteam.com
http://www.foxcitiessatellite.com
http://www.chargersmail.com
http://www.fighterplace.com
Best regards,
Vladimir Goncharov
The text was updated successfully, but these errors were encountered: