Bug 1787962

Summary: python-mako fails to build with Python 3.9: DeprecationWarning treated as error: The parser module is deprecated
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-makoAssignee: Miro Hrončok <mhroncok>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: aurelien, clems.verna, cstratak, igor.raits, kylev, lewk, mbayer, mhroncok, mplch, python-sig
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-28 09:58:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1793184    
Bug Blocks: 1785415    

Description Miro Hrončok 2020-01-05 23:23:18 UTC
python-mako fails to build with Python 3.9.0a2.

Traceback (most recent call last):
  File "/builddir/build/BUILD/mako-rel_1_1_0/test/test_template.py", line 1391, in _do_test_traceback
    template = Template(**templateargs)
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/template.py", line 348, in __init__
    module = self._compile_from_file(path, filename)
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/template.py", line 430, in _compile_from_file
    code, module = _compile_text(self, data, filename)
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/template.py", line 733, in _compile_text
    source, lexer = _compile(
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/template.py", line 712, in _compile
    node = lexer.parse()
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/lexer.py", line 272, in parse
    if self.match_python_block():
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/lexer.py", line 412, in match_python_block
    self.append_node(
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/lexer.py", line 152, in append_node
    node = nodecls(*args, **kwargs)
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/parsetree.py", line 159, in __init__
    self.code = ast.PythonCode(text, **self.exception_kwargs)
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/ast.py", line 43, in __init__
    expr = pyparser.parse(code.lstrip(), "exec", **exception_kwargs)
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/pyparser.py", line 47, in parse
    raise exceptions.SyntaxException(
mako.exceptions.SyntaxException: (SyntaxError) invalid syntax (<unknown>, line 1) ("print 'Alors vous imaginez ma surprise, au lever d") in file '/builddir/build/BUILD/mako-rel_1_1_0/test/templates/unicode_runtime_error.html' at line: 2 char: 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/mako-rel_1_1_0/test/test_template.py", line 1408, in _do_test
    self._do_test_traceback(utf8, memory, syntax)
  File "/builddir/build/BUILD/mako-rel_1_1_0/test/test_template.py", line 1396, in _do_test_traceback
    tback = exceptions.RichTraceback()
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/exceptions.py", line 93, in __init__
    self.records = self._init(traceback)
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/exceptions.py", line 242, in _init
    encoding = util.parse_encoding(fp)
  File "/builddir/build/BUILD/mako-rel_1_1_0/mako/util.py", line 260, in parse_encoding
    import parser
DeprecationWarning: The parser module is deprecated and will be removed in future versions of Python

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01138896-python-mako/

For all our attempts to build python-mako with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/python-mako/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33, but the initial bootstrapping has already started.
A build failure this early in the bootstrap sequence blocks us very much.

Comment 2 Michael Bayer 2020-01-20 21:17:57 UTC
Mako 1.1.1 is released which includes this fix.

Comment 4 Ben Cotton 2020-02-11 16:33:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.