question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
nateprewittcommented, 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.

0reactions
gelodefaultbraincommented, Sep 12, 2020

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

https://github.com/psf/requests/issues/4248

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found