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

Mako unable to import on Python 3.8 #296

Closed
amol- opened this issue Jun 3, 2019 · 4 comments

Comments

Projects
None yet
4 participants
@amol-
Copy link

commented Jun 3, 2019

From TurboGears2 test suite:

  File "/home/travis/build/TurboGears/tg2/tg/renderers/mako.py", line 23, in <module>
    from mako.template import Template
  File "/home/travis/virtualenv/python3.8-dev/lib/python3.8/site-packages/mako/template.py", line 20, in <module>
    from mako import codegen
  File "/home/travis/virtualenv/python3.8-dev/lib/python3.8/site-packages/mako/codegen.py", line 13, in <module>
    from mako import ast
  File "/home/travis/virtualenv/python3.8-dev/lib/python3.8/site-packages/mako/ast.py", line 14, in <module>
    from mako import pyparser
  File "/home/travis/virtualenv/python3.8-dev/lib/python3.8/site-packages/mako/pyparser.py", line 17, in <module>
    from mako import _ast_util
  File "/home/travis/virtualenv/python3.8-dev/lib/python3.8/site-packages/mako/_ast_util.py", line 67, in <module>
    from _ast import Str
ImportError: cannot import name 'Str' from '_ast' (unknown location)

Seems that mako is relying on _ast.Str which got recently removed from Python3.8: python/cpython@3f22811#diff-4d3d72b905c99b789fe1a7af29bcd55dL8248 (See python/cpython#9445 )

@zzzeek

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

oh because I removed all the "bad" "import *". haha, that sucks. now we have to add all the conditionals for those.

@sqla-tester

This comment has been minimized.

Copy link
Collaborator

commented Jun 3, 2019

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

Remove all non-essential functions from _ast_util.py https://gerrit.sqlalchemy.org/1299

@praiskup

This comment has been minimized.

Copy link

commented Jun 5, 2019

just curious, is there ETA for releasing this? It seems to break python3.8 unit tests in travis

@zzzeek

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

python 3.8 is still in beta so I generally don't release the same day as a fix though i was going to get to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.