ValueError: invalid literal for int() with base 16: b''
See original GitHub issueSummary.
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
#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).
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
ValueError: invalid literal for int() with base 16: '\x0e\xa3' Python
So you need to change string w=int(x, 16) to w = struct.unpack("h", x)[0] or to w = struct.unpack("H", x)[0] , it depends on...
Read more >ValueError: invalid literal for int() with base 16 - Yawin Tutor
The int(val, 16) function converts the given string or hex decimal number to an integer. The default base for the int() buit-in function...
Read more >What is the meaning of invalid literal for int() with base = ' '?
The chars a, b, c, d, e, and f are present in the base =16 system and therefore only these chars along with...
Read more >Invalid literal for int() with base 10 - Kodlogs.net
An error arises when we change the user input to an integer especially because python often stores user input as a string with...
Read more >Getting ValueError: invalid literal for int() with base 16 - Reddit
I would double check your check_hex() function. If you run it against the input 'Z0238984', it should return False. If it returns True,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Then thanks to this guy right here cause a random guy just fixed everything
https://github.com/psf/requests/issues/4248