The requests library expects this value to be 0. By overriding it with 5, it causes any HTTPAdapter created with max_retires set to 5 is will actually be created with a retry count of 0.
EXPECTED RESULTS
If I write other code that sets a max_retries value of 5 using the HTTPAdapter class, it should use that value.
ACTUAL RESULTS
Setting a max_retries value of 5 in any other code in a python project that includes the jenkinsapi package will disable retries.
ISSUE TYPE
Jenkinsapi VERSION
0.3.11 / latest 'master' branch
Jenkins VERSION
Any
SUMMARY
The line here: https://github.com/pycontribs/jenkinsapi/blob/master/jenkinsapi/utils/requester.py#L26 overrides
DEFAULT_RETRIES
value. However therequests
library has changed and that no longer sets the default retry value globally. Now, it causes a breakage with the requests library for other code that uses thejenkinsapi
package.There is a problematic interaction with the code here: https://github.com/psf/requests/blob/master/requests/adapters.py#L116
The
requests
library expects this value to be0
. By overriding it with5
, it causes anyHTTPAdapter
created withmax_retires
set to5
is will actually be created with a retry count of0
.EXPECTED RESULTS
If I write other code that sets a
max_retries
value of 5 using theHTTPAdapter
class, it should use that value.ACTUAL RESULTS
Setting a
max_retries
value of5
in any other code in a python project that includes thejenkinsapi
package will disable retries.USEFUL INFORMATION
The fix is to delete this line (https://github.com/pycontribs/jenkinsapi/blob/master/jenkinsapi/utils/requester.py#L26), it is not doing anything anymore except causing this bug. The functionality for setting retries was already implemented into master in PR #739 .