Skip to content

inspect.getfullargspec() is deprecated in python 3.8 #295

Closed

Description

@zzzeek

as in sqlalchemy/sqlalchemy#4674

and sqlalchemy/alembic#563

need to rebuild based on Signature for what we need

Activity

  1. zzzeek commented on May 16, 2019

    @zzzeek
    MemberAuthor

    we are using getargspec in exactly the prehistoric "turbogears" plugin, and we're using it on our own Template.init which seems kind of silly. we should just remove it

  2. zzzeek commented on May 16, 2019

    @zzzeek
    MemberAuthor

    bzzt I'm wrong, we should fix the TG thing but we use it in runtime as well via inspect_func_args

  3. zzzeek commented on May 16, 2019

    @zzzeek
    MemberAuthor

    getargspec is used in Mako for

    • TG thing which we can remove

    • kwargs_for_callable and kwargs_for_include which are template callables generated by mako

  4. zzzeek commented on May 16, 2019

    @zzzeek
    MemberAuthor

    here is the turbogears part:

    diff --git a/mako/ext/turbogears.py b/mako/ext/turbogears.py
    index eaa2d78..8e0394d 100644
    --- a/mako/ext/turbogears.py
    +++ b/mako/ext/turbogears.py
    @@ -29,9 +29,9 @@ class TGPlugin(object):
             self.lookup = TemplateLookup(**lookup_options)
     
             self.tmpl_options = {}
    -        # transfer lookup args to template args, based on those available
    -        # in getargspec
    -        for kw in compat.inspect_getargspec(Template.__init__)[0]:
    +        # transfer lookup args to template args, based on those which
    +        # the TemplateLookup would use
    +        for kw in self.lookup.template_args:
                 if kw in lookup_options:
                     self.tmpl_options[kw] = lookup_options[kw]
    
    

    but the rest has to be from a new approach to getfullargspec

  5. zzzeek commented on Jul 27, 2019

    @zzzeek
    MemberAuthor

    this needs to be vendored the same way we did it at sqlalchemy/sqlalchemy#4674, cut and paste

  6. sqla-tester commented on Jul 27, 2019

    @sqla-tester
    Collaborator

    Mike Bayer has proposed a fix for this issue in the master branch:

    Bump Python versions, remove conditional imports https://gerrit.sqlalchemy.org/1380

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpy3k

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions