Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Retry-requests
##############
Configures the passed-in requests' <http://python-requests.org>
_ Session
to retry on failed requests due to connection errors, timeouts,
specific HTTP response codes (5XX by default) and 30X redirections
—anything that could fail.
Python 3.6+.
Basic usage:
.. code-block:: python
from retry_requests import retry my_session = retry() my_session.get("http://foo.bar")
This get
will retry three times in case of error waiting some time between retries.
Errors could be:
You can change these defaults:
.. code-block:: python
from retry_requests import retry from requests import Session my_session = retry(Session(), retries=5, backoff_factor=0.2) my_session.get('https://foo.bar')
Check the function retry
to know more about this configuration.
Note that you have a TSession
, a Session
with a default timeout,
and RSession
, a Session
with a timeout that always raise_for_status()
,
for your convenience.
Heavily inspired from Peterbe.com <https://www.peterbe.com/plog/ best-practice-with-retries-with-requests>
_. Thank you!
Installing
Just pip install retry-requests
.
Testing
Clone this project and then, at its root directory, run python setup.py test
.
Note that you need an active Internet connection to run the tests.
FAQs
Make requests's sessions auto-retry on failure.
We found that retry-requests demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.