sqlalchemy / sqlalchemy/dogpile.cache

support python3 keyword-only arguments for function decorator

Open
#96 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug high priority
Dominant language
Python
Stars
299
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Migrated issue, originally created by Anonymous

getargspec() is deprecated in python 3.0

When running against 3.5, I get the following ValueError...

File "/.pyenv/versions/env/lib/python3.5/site-packages/dogpile/cache/region.py", line 1037, in decorator
key_generator = function_key_generator(namespace, fn)
File "
/.pyenv/versions/env/lib/python3.5/site-packages/dogpile/cache/util.py", line 73, in function_key_generator
args = inspect.getargspec(fn)
File "~/.pyenv/versions/3.5.0/lib/python3.5/inspect.py", line 1044, in getargspec
raise ValueError("Function has keyword-only arguments or annotations"
ValueError: Function has keyword-only arguments or annotations, use getfullargspec() API which can support them

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in dogpile/cache/util.py at function_key_generator, where inspect.getargspec(fn) raises for keyword-only arguments; review its use from dogpile/cache/region.py around the reported decorator path. Reproduce the failure on Python 3.5 with a function containing keyword-only arguments, and consider the issue done when the decorator accepts that function without the shown ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.