Skip to content

Python 3.8 test error: AttributeError: 'Constant' object has no attribute 'n' #47

Closed
@hroncok

Description

@hroncok

This is Python 3.8.0a3. I had to modify the tox.ini to have basepython set for 3.8:

diff --git a/tox.ini b/tox.ini
index c81ac77..f40958d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
 [tox]
 envlist =
-    py27,py33,py34,py35,py36,py37,pypy,
+    py27,py33,py34,py35,py36,py37,py38,pypy,
     docs,{py2,py3}-cover,coverage
 skip_missing_interpreters = True
 
@@ -14,6 +14,7 @@ basepython =
     py35: python3.5
     py36: python3.6
     py37: python3.7
+    py38: python3.8
     pypy: pypy
     py2: python2.7
     py3: python3.5

And when i run tox for 3.8 on master (333986c):

$ tox -e py38
GLOB sdist-make: .../pyramid_mako/setup.py
py38 inst-nodeps: .../pyramid_mako/.tox/.tmp/package/1/pyramid_mako-1.0.3.dev0.zip
py38 installed: beautifulsoup4==4.7.1,coverage==4.5.3,hupper==1.6.1,Mako==1.0.8,MarkupSafe==1.1.1,nose==1.3.7,PasteDeploy==2.0.1,plaster==1.0,plaster-pastedeploy==0.6,pyramid==1.10.2,pyramid-mako==1.0.3.dev0,six==1.12.0,soupsieve==1.9,translationstring==1.3,venusian==1.2.0,waitress==1.2.1,WebOb==1.8.5,WebTest==2.0.33,zope.deprecation==4.4.0,zope.interface==4.6.0
py38 run-test-pre: PYTHONHASHSEED='1721400932'
py38 runtests: commands[0] | pip install 'pyramid_mako[testing]'
Requirement already satisfied: pyramid_mako[testing] in ./.tox/py38/lib/python3.8/site-packages (1.0.3.dev0)
Requirement already satisfied: Mako>=0.8 in ./.tox/py38/lib/python3.8/site-packages (from pyramid_mako[testing]) (1.0.8)
Requirement already satisfied: pyramid in ./.tox/py38/lib/python3.8/site-packages (from pyramid_mako[testing]) (1.10.2)
Requirement already satisfied: nose; extra == "testing" in ./.tox/py38/lib/python3.8/site-packages (from pyramid_mako[testing]) (1.3.7)
Requirement already satisfied: WebTest>=1.3.1; extra == "testing" in ./.tox/py38/lib/python3.8/site-packages (from pyramid_mako[testing]) (2.0.33)
Requirement already satisfied: coverage; extra == "testing" in ./.tox/py38/lib/python3.8/site-packages (from pyramid_mako[testing]) (4.5.3)
Requirement already satisfied: MarkupSafe>=0.9.2 in ./.tox/py38/lib/python3.8/site-packages (from Mako>=0.8->pyramid_mako[testing]) (1.1.1)
Requirement already satisfied: zope.interface>=3.8.0 in ./.tox/py38/lib/python3.8/site-packages (from pyramid->pyramid_mako[testing]) (4.6.0)
Requirement already satisfied: plaster in ./.tox/py38/lib/python3.8/site-packages (from pyramid->pyramid_mako[testing]) (1.0)
Requirement already satisfied: plaster-pastedeploy in ./.tox/py38/lib/python3.8/site-packages (from pyramid->pyramid_mako[testing]) (0.6)
Requirement already satisfied: zope.deprecation>=3.5.0 in ./.tox/py38/lib/python3.8/site-packages (from pyramid->pyramid_mako[testing]) (4.4.0)
Requirement already satisfied: translationstring>=0.4 in ./.tox/py38/lib/python3.8/site-packages (from pyramid->pyramid_mako[testing]) (1.3)
Requirement already satisfied: venusian>=1.0 in ./.tox/py38/lib/python3.8/site-packages (from pyramid->pyramid_mako[testing]) (1.2.0)
Requirement already satisfied: hupper in ./.tox/py38/lib/python3.8/site-packages (from pyramid->pyramid_mako[testing]) (1.6.1)
Requirement already satisfied: webob>=1.8.3 in ./.tox/py38/lib/python3.8/site-packages (from pyramid->pyramid_mako[testing]) (1.8.5)
Requirement already satisfied: setuptools in ./.tox/py38/lib/python3.8/site-packages (from pyramid->pyramid_mako[testing]) (41.0.0)
Requirement already satisfied: beautifulsoup4 in ./.tox/py38/lib/python3.8/site-packages (from WebTest>=1.3.1; extra == "testing"->pyramid_mako[testing]) (4.7.1)
Requirement already satisfied: six in ./.tox/py38/lib/python3.8/site-packages (from WebTest>=1.3.1; extra == "testing"->pyramid_mako[testing]) (1.12.0)
Requirement already satisfied: waitress>=0.8.5 in ./.tox/py38/lib/python3.8/site-packages (from WebTest>=1.3.1; extra == "testing"->pyramid_mako[testing]) (1.2.1)
Requirement already satisfied: PasteDeploy>=1.5.0 in ./.tox/py38/lib/python3.8/site-packages (from plaster-pastedeploy->pyramid->pyramid_mako[testing]) (2.0.1)
Requirement already satisfied: soupsieve>=1.2 in ./.tox/py38/lib/python3.8/site-packages (from beautifulsoup4->WebTest>=1.3.1; extra == "testing"->pyramid_mako[testing]) (1.9)
py38 runtests: commands[1] | nosetests --with-xunit --xunit-file=nosetests-py38.xml
.E..............................................................................
======================================================================
ERROR: test_call_render_raises (pyramid_mako.tests.MakoLookupTemplateRendererTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../pyramid_mako/pyramid_mako/__init__.py", line 148, in __call__
    result = template.render_unicode(**system)
  File ".../pyramid_mako/pyramid_mako/tests.py", line 665, in render_unicode
    raise self.render_exc
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../pyramid_mako/pyramid_mako/tests.py", line 364, in test_call_render_raises
    instance({}, {})
  File ".../pyramid_mako/pyramid_mako/__init__.py", line 152, in __call__
    errtext = text_error_template().render(
  File ".../pyramid_mako/.tox/py38/lib/python3.8/site-packages/mako/exceptions.py", line 236, in text_error_template
    return mako.template.Template(r"""
  File ".../pyramid_mako/.tox/py38/lib/python3.8/site-packages/mako/template.py", line 320, in __init__
    (code, module) = _compile_text(self, text, filename)
  File ".../pyramid_mako/.tox/py38/lib/python3.8/site-packages/mako/template.py", line 704, in _compile_text
    source, lexer = _compile(template, text, filename,
  File ".../pyramid_mako/.tox/py38/lib/python3.8/site-packages/mako/template.py", line 686, in _compile
    source = codegen.compile(node,
  File ".../pyramid_mako/.tox/py38/lib/python3.8/site-packages/mako/codegen.py", line 52, in compile
    _GenerateRenderMethod(printer,
  File ".../pyramid_mako/.tox/py38/lib/python3.8/site-packages/mako/codegen.py", line 127, in __init__
    args = pagetag.body_decl.get_argument_expressions()
  File ".../pyramid_mako/.tox/py38/lib/python3.8/site-packages/mako/ast.py", line 175, in get_argument_expressions
    name, pyparser.ExpressionGenerator(default).value()))
  File ".../pyramid_mako/.tox/py38/lib/python3.8/site-packages/mako/pyparser.py", line 230, in __init__
    self.generator.visit(astnode)
  File ".../pyramid_mako/.tox/py38/lib/python3.8/site-packages/mako/_ast_util.py", line 279, in visit
    return f(node)
  File ".../pyramid_mako/.tox/py38/lib/python3.8/site-packages/mako/_ast_util.py", line 685, in visit_Constant
    self.write(repr(node.n))
AttributeError: 'Constant' object has no attribute 'n'

----------------------------------------------------------------------
Ran 80 tests in 0.367s

FAILED (errors=1)
ERROR: InvocationError for command '.../pyramid_mako/.tox/py38/bin/nosetests --with-xunit --xunit-file=nosetests-py38.xml' (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   py38: commands failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions