pyowm icon indicating copy to clipboard operation
pyowm copied to clipboard

Python 3.12: TypeError: Retry.__init__() got an unexpected keyword argument 'method_whitelist'

Open carlo161 opened this issue 5 months ago • 0 comments

I installed last version of pyowm in a virtual environment and I receive the following message:

File "/usr/src/app/classes/weatherScanner.py", line 25, in elementInit
    .weather_manager())
     ^^^^^^^^^^^^^^^^^
  File "/usr/src/app/venv/lib/python3.12/site-packages/pyowm/owm.py", line 127, in weather_manager
    return weather_manager.WeatherManager(self.api_key, self.config)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/venv/lib/python3.12/site-packages/pyowm/weatherapi25/weather_manager.py", line 32, in __init__
    self.http_client = HttpClient(API_key, config, ROOT_WEATHER_API)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/venv/lib/python3.12/site-packages/pyowm/commons/http_client.py", line 127, in __init__
    max_retries=Retry(
                ^^^^^^
TypeError: Retry.__init__() got an unexpected keyword argument 'method_whitelist'

By googling around I found out that: From the urllib3 2.0.0 changelog, here's the cause of the issue:

Removed deprecated Retry options method_whitelist, DEFAULT_REDIRECT_HEADERS_BLACKLIST (https://github.com/urllib3/urllib3/pull/2086).

Am I the only one with this issue? Is anyone going to fix the package?

carlo161 avatar Sep 11 '24 22:09 carlo161