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

DeprecationWarning: inspect.getargspec() is deprecated #129

Closed
sqlalchemy-bot opened this issue Aug 24, 2018 · 5 comments
Closed

DeprecationWarning: inspect.getargspec() is deprecated #129

sqlalchemy-bot opened this issue Aug 24, 2018 · 5 comments
Labels
bug Something isn't working decorators py3k things to do with python 3 changes

Comments

@sqlalchemy-bot
Copy link

Migrated issue, originally created by Randy Barlow (bowlofeggs)

Greetings!

In Python 3.6, I see a few warnings like this:

  /usr/local/lib/python3.6/site-packages/dogpile/cache/util.py:31: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
    args = inspect.getargspec(fn)
@sqlalchemy-bot
Copy link
Author

Michael Bayer (zzzeek) wrote:

OK....it was formatargspec that I had to vendor in SQLAlchemy, getargspec is easier as they have thankfully not deprecated getfullargspec().

the code that codes into dogpile/util/compat.py looks like:

#!python

if py3k:
    ArgSpec = collections.namedtuple("ArgSpec",
                                     ["args", "varargs", "keywords", "defaults"])

    from inspect import getfullargspec as inspect_getfullargspec

    def inspect_getargspec(func):
        return ArgSpec(
            *inspect_getfullargspec(func)[0:4]
        )
else:
    from inspect import getargspec as inspect_getfullargspec
    inspect_getargspec = inspect_getfullargspec

@zzzeek
Copy link
Member

zzzeek commented Dec 7, 2018

this got lost, can't believe i havent gotten all these yet across the three projects

@sqlalchemy-bot
Copy link
Author

Mike Bayer has proposed a fix for this issue:

Fix all Py3k deprecation warnings https://gerrit.sqlalchemy.org/1002

@zzzeek zzzeek added the py3k things to do with python 3 changes label Dec 7, 2018
@zzzeek
Copy link
Member

zzzeek commented Dec 7, 2018

fix did not pass all tests when master ran. ci for gerrit is apparently not resetting enough

@zzzeek zzzeek reopened this Dec 7, 2018
@sqlalchemy-bot
Copy link
Author

Mike Bayer has proposed a fix for this issue:

Fix all Py3k deprecation warnings https://gerrit.sqlalchemy.org/1006

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working decorators py3k things to do with python 3 changes
Projects
None yet
Development

No branches or pull requests

2 participants