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

incompatible with python 3.11 #262

Open
dschep opened this issue Feb 3, 2023 · 6 comments
Open

incompatible with python 3.11 #262

dschep opened this issue Feb 3, 2023 · 6 comments
Labels

Comments

@dschep
Copy link
Owner

dschep commented Feb 3, 2023

getargspec was removed from the inspect module AFAICT. First reported in #190

@karlicoss
Copy link

Until this is fixed in master, you can try this workaround (if you're calling ntfy from python)

def hack(*args, **kwargs):
    raise RuntimeError("TODO")

import inspect
inspect.getargspec = hack

from ntfy.cli import main as ntfy_main
ntfy_main([
    '-b', 'some_backend',
    '-t', 'TITLE',
    'send', 'BODY',
])

The error hander isn't used on the "happy path" so doesn't matter much what exactly you put into hack function.

@mgerasimchuk
Copy link

mgerasimchuk commented Oct 12, 2023

Hotfix with the additional version of python for your mac:

brew install [email protected]
pip3.9 install ntfy
sed -I '' -E 's/[0-9]+.[0-9]+/3.9/g' /opt/homebrew/bin/ntfy

@zakariassen
Copy link

zakariassen commented Oct 16, 2023

At least on my machine, changing getargspec to getfullargspec in init.py got ntfy working again on python 3.11.2.

@dschep
Copy link
Owner Author

dschep commented Oct 18, 2023

@zakariassen do you know if getfullargspec also existed in older versions of python (ie: is that backwards compatible fix?)

@zakariassen
Copy link

@zakariassen do you know if getfullargspec also existed in older versions of python (ie: is that backwards compatible fix?)

AFAIK, It is present in all versions of Python 3, from v3.0 forwards.

https://docs.python.org/3.0/library/inspect.html#inspect.getfullargspec

Just dumb luck on my account, testing if it would function as a drop-in replacement :)

@nwgat
Copy link

nwgat commented Dec 15, 2023

simple fix on ubutnu 23.10 with python 3.11
sed -i 's/getargspec/getfullargspec/' /usr/local/lib/python3.11/dist-packages/ntfy/__init__.py

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jan 21, 2024
Obtained from here:
dschep/ntfy#262

PR:		275494
Approved by:	portmgr (blanket approval)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants