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: 'staticmethod' object is not callable #13

Open
liucscai opened this issue Oct 29, 2023 · 7 comments
Open

TypeError: 'staticmethod' object is not callable #13

liucscai opened this issue Oct 29, 2023 · 7 comments
Assignees
Labels
bug Something isn't working compatibility Improvement of compatibility e.g. across python and/or library versions
Milestone

Comments

@liucscai
Copy link

I followed the instructions and installed ryanair-py on Python version 3.8.10 (Ubuntu Linux installation)
I tried running the code in the documentation, but I get the following error:

>>> flights = api.get_cheapest_flights("DUB", tomorrow, tomorrow + timedelta(days=1))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/luca/.local/lib/python3.8/site-packages/ryanair/ryanair.py", line 76, in get_cheapest_flights
    response = self._retryable_query(query_url, params)["fares"]
  File "/home/luca/.local/lib/python3.8/site-packages/backoff/_sync.py", line 92, in retry
    wait = _init_wait_gen(wait_gen, wait_gen_kwargs)
  File "/home/luca/.local/lib/python3.8/site-packages/backoff/_common.py", line 29, in _init_wait_gen
    initialized = wait_gen(**kwargs)
TypeError: 'staticmethod' object is not callable

Thanks in advance

@flintash
Copy link

flintash commented Oct 31, 2023

same error here, using debian and MX(debian based),
$ python3 --version
Python 3.9.2
getting:

 File "/home/xxx/.local/lib/python3.9/site-packages/ryanair/ryanair.py", line 133, in get_cheapest_return_flights
    response = self._retryable_query(query_url, params)["fares"]
  File "/home/xxx/.local/lib/python3.9/site-packages/backoff/_sync.py", line 92, in retry
    wait = _init_wait_gen(wait_gen, wait_gen_kwargs)
  File "/home/xxx/.local/lib/python3.9/site-packages/backoff/_common.py", line 29, in _init_wait_gen
    initialized = wait_gen(**kwargs)
TypeError: 'staticmethod' object is not callable

@cohaolain
Copy link
Owner

Thanks for the reports all, a bug may have been introduced in my last refactor, I'll take a look as soon as I get the time.

@flintash
Copy link

Acctually downgrading works, so its a way to have it working for time being.
pip3 install ryanair-py==2.3.1

@cohaolain cohaolain self-assigned this Nov 22, 2023
@cohaolain cohaolain added the bug Something isn't working label Nov 22, 2023
@cohaolain cohaolain added this to the v3.1 milestone Nov 22, 2023
@cohaolain
Copy link
Owner

cohaolain commented Nov 22, 2023

I suspect what's happening here is my most recent changes aren't compatible with python < 3.10.

Namely, from documentation https://docs.python.org/3/library/functions.html#staticmethod :

Changed in version 3.10: Static methods now inherit the method attributes (module, name, qualname, doc and annotations), have a new wrapped attribute, and are now callable as regular functions.

Python 3.9 isn't EOL until ~the end of 2025, so I will try to fix this at some point.

However, if easy for you, you can just switch to using python >= 3.10 for now :)

@cohaolain cohaolain added the compatibility Improvement of compatibility e.g. across python and/or library versions label Nov 22, 2023
@ivallesp
Copy link

The issue is still happening

@cohaolain
Copy link
Owner

Yes, I still haven't gotten around to fixing this on python < 3.10.

To avoid this issue, please use python >= 3.10 for now if you can, or use the previous version of this library ryanair-py==2.3.1.

SorakaMafaka added a commit to SorakaMafaka/ryanair-py that referenced this issue Feb 15, 2024
@SorakaMafaka
Copy link

Appreciate any feedback on the pull request @cohaolain :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility Improvement of compatibility e.g. across python and/or library versions
Projects
None yet
Development

No branches or pull requests

5 participants