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

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

Closed
zzzeek opened this issue May 16, 2019 · 6 comments
Closed

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

zzzeek opened this issue May 16, 2019 · 6 comments
Labels
bug Something isn't working py3k

Comments

@zzzeek
Copy link
Member

zzzeek commented May 16, 2019

as in sqlalchemy/sqlalchemy#4674

and sqlalchemy/alembic#563

need to rebuild based on Signature for what we need

@zzzeek
Copy link
Member Author

zzzeek commented May 16, 2019

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

@zzzeek zzzeek added bug Something isn't working py3k labels May 16, 2019
@zzzeek
Copy link
Member Author

zzzeek commented May 16, 2019

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

@zzzeek
Copy link
Member Author

zzzeek commented May 16, 2019

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

@zzzeek
Copy link
Member Author

zzzeek commented May 16, 2019

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

@zzzeek
Copy link
Member Author

zzzeek commented Jul 27, 2019

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

@sqla-tester
Copy link
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
Labels
bug Something isn't working py3k
Projects
None yet
Development

No branches or pull requests

2 participants