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

ValueError: invalid literal for int() with base 16: b'' #5583

Closed
gelodefaultbrain opened this issue Sep 11, 2020 · 7 comments
Closed

ValueError: invalid literal for int() with base 16: b'' #5583

gelodefaultbrain opened this issue Sep 11, 2020 · 7 comments

Comments

@gelodefaultbrain
Copy link

Summary.

I am just trying to make a http request on a certain website, the thing is I am making requests for a lot of website and I am doing it in a for loop and that error on the title SOMETIMES shows up! YES SOMETIMES! there would be times that it occurs and not

What you expected.

Expect to have a good result

What happened instead.

This is what happened
image

#My Python version is 3.8.2

import requests
url = "somesite.com"
r = requests.get(url)

System Information

$ python -m requests.help
<paste here>

This command is only available on Requests v2.16.4 and greater. Otherwise,
please provide some basic information about your system (Python version,
operating system, &c).

@gelodefaultbrain
Copy link
Author

By the way this is my version of the requests library

image

@gelodefaultbrain
Copy link
Author

i have also read some fixes from other people here is the site

#4248

There is a guy here that has the solution but I was thinking that maybe the developers could have another which is of course the developers are the one that I am going to consider first...

Please I needed this badly Thank you!

@sigmavirus24
Copy link
Contributor

Your server is sending chunked data without following the HTTP specification. Nothing here to be fixed as the actual error you're encountering is the Incomplete read exception at the bottom of your screenshot (which isn't friendly for future folks searching or using screen readers).

@gelodefaultbrain
Copy link
Author

There is definitely need to be fixed I think cause some people experience this too... They have provided solutions on it I was just thinking if the devs can somehow make a way through this?

#4248

@sigmavirus24
Copy link
Contributor

Nope. I'm a former dev and I can promise there's no solution to broken servers

@gelodefaultbrain
Copy link
Author

Then thanks to this guy right here cause a random guy just fixed everything

#4248

@nateprewitt
Copy link
Member

nateprewitt commented Sep 14, 2020

To be clear, this isn't a universal fix. It will cause breakages elsewhere for valid use cases, so urllib3 can't implement this fix. I'm going to resolve this since it's not a defect in Requests but in the external server implementation.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants