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

Comments

@zzzeek
Copy link
Member

@zzzeek 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 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

Loading

@zzzeek
Copy link
Member Author

@zzzeek 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

Loading

@zzzeek
Copy link
Member Author

@zzzeek 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

Loading

@zzzeek
Copy link
Member Author

@zzzeek 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

Loading

@zzzeek
Copy link
Member Author

@zzzeek zzzeek commented Jul 27, 2019

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

Loading

@sqla-tester
Copy link
Collaborator

@sqla-tester sqla-tester commented Jul 27, 2019

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

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

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants