There seems to be a dependency issue with FrameIO and newer builds of urllib3. In client.py in class FrameIOConnection, ‘method_whitelist’ parameter is listed. Newer builds of urllib3 changed this name to ‘allowed_methods’. With the older naming the frameio client throws an "unexpected keyword argument ’ exception if you have a newer version of urllib3 with that breaking change.
opened 09:59AM - 25 Nov 20 UTC
closed 08:16PM - 02 Jan 23 UTC
### Subject
`method_whitelist` parameter was apparently replaced by a raciall… y-neutral (and actually easier to understand in this case) `allowed_methods`. The old parameter was deprecated.
However, it seems that continuing to use `method_whitelist` breaks the machinery upon actual retry, at least in some usage patterns.
It is easy for me to change to `allowed_methods` for new use, but I would love to support some older installations requiring `urllib3==1.25.10`. The new parameter name is not supported on `1.25.10`.
There is also risk that existing code would break if `urllib3` was upgraded in an existing environment.
### Environment
```python
>>> print("OS", platform.platform())
OS Linux-5.4.0-52-generic-x86_64-with-glibc2.29
>>> print("Python", platform.python_version())
Python 3.8.5
>>> print("urllib3", urllib3.__version__)
urllib3 1.26.2
```
### Steps to Reproduce
Consider the following test case, named `test.py`:
```python
import pytest
import urllib3
import urllib3.exceptions
import urllib3.util.retry
class CustomRetry(urllib3.util.retry.Retry):
TEST_STATUS_FORCELIST = frozenset({502, 503, 504})
TEST_ALLOWED_METHODS = frozenset({'HEAD', 'GET', 'TRACE'})
def __init__(self, *args, **kwargs):
kwargs['method_whitelist'] = self.TEST_ALLOWED_METHODS
kwargs['status_forcelist'] = self.TEST_STATUS_FORCELIST
super().__init__(*args, **kwargs)
def test_retry():
retries = CustomRetry(total=5)
http = urllib3.PoolManager(retries=retries)
with pytest.raises(urllib3.exceptions.MaxRetryError):
http.request('GET', 'https://httpstat.us/502')
```
The ubiquitous `pytest` is needed to run it:
```
pytest test.py
```
### Expected Behavior
Test attached test case is expected to pass.
### Actual Behavior
:boom:
```
<my venv>/lib/python3.8/site-packages/urllib3/request.py:74: in request
return self.request_encode_url(
<my venv>/lib/python3.8/site-packages/urllib3/request.py:96: in request_encode_url
return self.urlopen(method, url, **extra_kw)
<my venv>/lib/python3.8/site-packages/urllib3/poolmanager.py:375: in urlopen
response = conn.urlopen(method, u.request_uri, **kw)
<my venv>/lib/python3.8/site-packages/urllib3/connectionpool.py:836: in urlopen
retries = retries.increment(method, url, response=response, _pool=self)
<my venv>/lib/python3.8/site-packages/urllib3/util/retry.py:562: in increment
new_retry = self.new(
<my venv>/lib/python3.8/site-packages/urllib3/util/retry.py:319: in new
return type(self)(**params)
test.py:14: in __init__
super().__init__(*args, **kwargs)
ValueError: Using both 'allowed_methods' and 'method_whitelist' together is not allowed. Instead only use 'allowed_methods'
```