1

In my application till now I have been using flask-caching 1.0 but now I have to upgrade it to version 1.8 to use the newly intriduced changes but with python 2.7 its giving attribute error AttributeError: 'module' object has no attribute 'signature' and I can see that in python 2.7 version inspect module has no attribute signature available.

Stack trace

ERROR:flask_caching:Exception possibly due to cache backend.
Traceback (most recent call last):
  File "/Users/user_profile/workspace/app/venv/lib/python2.7/site-packages/flask_caching/__init__.py", line 795, in decorated_function
    f, *args, **kwargs
  File "/Users/user_profile/workspace/app/venv/lib/python2.7/site-packages/flask_caching/__init__.py", line 592, in make_cache_key
    f, args=args, timeout=_timeout, forced_update=forced_update
  File "/Users/user_profile/workspace/app/venv/lib/python2.7/site-packages/flask_caching/__init__.py", line 529, in _memoize_version
    fname, instance_fname = function_namespace(f, args=args)
  File "/Users/user_profile/workspace/app/venv/lib/python2.7/site-packages/flask_caching/__init__.py", line 80, in function_namespace
    m_args = get_arg_names(f)
  File "/Users/user_profile/workspace/app/venv/lib/python2.7/site-packages/flask_caching/__init__.py", line 59, in get_arg_names
    sig = inspect.signature(f)
AttributeError: 'module' object has no attribute 'signature'

Any suggestion to fix the problem.

Kaushal Pahwani
  • 464
  • 3
  • 11
  • Check the docs for the successor of `signature` attribute. It should be there and if it isn't then you will have to downgrade your module version back to 1.0 – AzyCrw4282 Apr 18 '20 at 09:14
  • 1
    No I don't see any successor for `signature`. I will have to keep using the older package. – Kaushal Pahwani Apr 22 '20 at 05:37

0 Answers0