ntfy icon indicating copy to clipboard operation
ntfy copied to clipboard

incompatible with python 3.11

Open dschep opened this issue 2 years ago • 6 comments

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

dschep avatar Feb 03 '23 14:02 dschep

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.

karlicoss avatar Jul 11 '23 14:07 karlicoss

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

mgerasimchuk avatar Oct 12 '23 10:10 mgerasimchuk

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

zakariassen avatar Oct 16 '23 17:10 zakariassen

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

dschep avatar Oct 18 '23 17:10 dschep

@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 :)

zakariassen avatar Oct 18 '23 18:10 zakariassen

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

nwgat avatar Dec 15 '23 14:12 nwgat