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

TypeError: Retry.__init__() got an unexpected keyword argument 'allowed_methods' #80

Open
DimitrovC opened this issue Oct 17, 2023 · 4 comments

Comments

@DimitrovC
Copy link

Describe the bug
Pydactyl / Requests don't work on ubuntu 22.04 using python 3.11

To Reproduce
Code: client = PterodactylClient(API_Link, API_Code)

Error:
Traceback (most recent call last):
File "/var/www/discordbot/app.py", line 37, in
client = PterodactylClient(API_Link, API_Code)

File "/usr/local/lib/python3.11/dist-packages/pydactyl/api_client.py", line 69, in init
adapter = http_adapter(backoff_factor=backoff_factor,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pydactyl/api_client.py", line 16, in http_adapter
retries = requests.adapters.Retry(
^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Retry.init() got an unexpected keyword argument 'allowed_methods'

Expected behavior
When i tried to run the code on my linux vps i expected to work perfectly because it worked on my windows pc normally.

Environment

  • pydactyl version - 2.0.4
  • Python version - 3.11
@iamkubi
Copy link
Owner

iamkubi commented Oct 17, 2023

You need to update your requests library. The version in dev-requirements.txt should work, although I suppose I should add a requirements.txt that includes the correct requests version.

@DimitrovC
Copy link
Author

You need to update your requests library. The version in dev-requirements.txt should work, although I suppose I should add a requirements.txt that includes the correct requests version.

Actually i have updated the requests library to the latest version and still getting this error

@iamkubi
Copy link
Owner

iamkubi commented Oct 19, 2023

Technically it's the urllib3 version that requests depends on. The method_whitelist parameter was was deprecated and removed from urllib3 1.26.0 onwards, as stated in the release changelog.

If you install the "latest" requests version it will install a version of urllib3 that uses allowed_methods instead of method_whitelist.

@DimitrovC
Copy link
Author

Technically it's the urllib3 version that requests depends on. The method_whitelist parameter was was deprecated and removed from urllib3 1.26.0 onwards, as stated in the release changelog.

If you install the "latest" requests version it will install a version of urllib3 that uses allowed_methods instead of method_whitelist.

Its working, thanks.

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

2 participants