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

A warning is logged while using msrest where urllib3 issues: DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead #237

Open
harneetvirk opened this issue Mar 26, 2021 · 0 comments

Comments

@harneetvirk
Copy link

A warning is logged while using msrest where urllib3 issues DeprecationWarning about using 'method_whitelist' with Retry

DeprecationWarning: Using 'method_whitelist' with Retry is deprecated and will be removed in v2.0. Use 'allowed_methods' instead

Here is the code:

self.policy.method_whitelist = ['HEAD', 'TRACE', 'GET', 'PUT',

Proposal is to allow use of both parameters based on the version of the urllib3 like inline:

if urllib3_version < "1.26.0":

DEFAULT_RETRY = Retry(
    total=MAX_RETRY,
    backoff_factor=RETRY_BACKOFF_FACTOR,

method_whitelist=RETRY_METHODS,
status_forcelist=RETRY_STATUS_CODES,
raise_on_status=False,
)
else:
DEFAULT_RETRY = Retry(
total=MAX_RETRY,
backoff_factor=RETRY_BACKOFF_FACTOR,
allowed_methods=RETRY_METHODS,
status_forcelist=RETRY_STATUS_CODES,
raise_on_status=False,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant