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

Something more robust to deal with the following #4276

Closed
gjthompson1 opened this issue Sep 5, 2017 · 1 comment
Closed

Something more robust to deal with the following #4276

gjthompson1 opened this issue Sep 5, 2017 · 1 comment

Comments

@gjthompson1
Copy link

gjthompson1 commented Sep 5, 2017

Summary.

Seems a little overkill to have to do https://stackoverflow.com/questions/22346158/python-requests-how-to-limit-received-size-transfer-rate-and-or-total-time to deal with sites like the below. Would be nice to have that built in. But maybe thats asking to much.

Question on Stack: https://stackoverflow.com/questions/46061786/python-requests-timeout-not-working/46061958#46061958

Expected Result

Error with running:

requests.get('http://arboleascity.com',timeout=(5,5),verify=False)

What you expected.

Would timeout in 5 seconds. But it does not. It works 99.9% of the time but for this site it does not.

Probably a bug. Any help?

Reproduction Steps

import requests
requests.get('http://arboleascity.com',timeout=(5,5),verify=False)

System Information

$ python -m requests.help
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": ""
  },
  "idna": {
    "version": "2.6"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.5.2"
  },
  "platform": {
    "release": "4.4.0-1032-aws",
    "system": "Linux"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.18.4"
  },
  "system_ssl": {
    "version": "1000207f"
  },
  "urllib3": {
    "version": "1.22"
  },
  "using_pyopenssl": false
}
@gjthompson1 gjthompson1 changed the title Timeout Not working for example site Something more robust to deal with the following Sep 5, 2017
@sigmavirus24
Copy link
Contributor

The answer is in your StackOverflow question. Your connection is likely taking less than 5 seconds and you're probably receiving some data at least once every 5 seconds. What you seem to be expecting is some kind of total timeout on the time it takes to complete downloading the response and that's not something that we can provide at this point in time.

You can search closed issues for other discussions of this and look specifically for "total timeout" or "wall clock timeout". There are other 3rd party solutions that can help you achieve your goal.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 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

2 participants