Bug 1830799 - babel fails to build with Python 3.9: test_util.py test failures
Summary: babel fails to build with Python 3.9: test_util.py test failures
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: babel
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Felix Schwarz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-05-03 22:42 UTC by Miro Hrončok
Modified: 2020-05-05 08:35 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 08:35:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github python-babel babel issues 709 0 None open test_parse_future in test_util.py fails with Python 3.9 2020-05-04 20:14:36 UTC

Description Miro Hrončok 2020-05-03 22:42:54 UTC
babel fails to build with Python 3.9.0a6:

=================================== FAILURES ===================================
_ test_parse_future[\nfrom __future__ import print_function,\n    division, with_statement,\n    unicode_literals\n-237568] _
source = '\nfrom __future__ import print_function,\n    division, with_statement,\n    unicode_literals\n'
result = 237568
    @pytest.mark.parametrize('source, result', [
        ('''
    from __future__ import print_function,
        division, with_statement,
        unicode_literals
    ''', 0x10000 | 0x2000 | 0x8000 | 0x20000),
        ('''
    from __future__ import print_function, division
    print('hello')
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import print_function, division, unknown,,,,,
    print 'hello'
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import (
        print_function,
        division)
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import \\
        print_function, \\
        division
    ''', 0x10000 | 0x2000),
    ])
    def test_parse_future(source, result):
        fp = BytesIO(source.encode('latin-1'))
        flags = parse_future_flags(fp)
>       assert flags == result
E       assert 3801088 == 237568
tests/test_util.py:96: AssertionError
_ test_parse_future[\nfrom __future__ import print_function, division\nprint('hello')\n-73728] _
source = "\nfrom __future__ import print_function, division\nprint('hello')\n"
result = 73728
    @pytest.mark.parametrize('source, result', [
        ('''
    from __future__ import print_function,
        division, with_statement,
        unicode_literals
    ''', 0x10000 | 0x2000 | 0x8000 | 0x20000),
        ('''
    from __future__ import print_function, division
    print('hello')
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import print_function, division, unknown,,,,,
    print 'hello'
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import (
        print_function,
        division)
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import \\
        print_function, \\
        division
    ''', 0x10000 | 0x2000),
    ])
    def test_parse_future(source, result):
        fp = BytesIO(source.encode('latin-1'))
        flags = parse_future_flags(fp)
>       assert flags == result
E       assert 1179648 == 73728
tests/test_util.py:96: AssertionError
_ test_parse_future[\nfrom __future__ import print_function, division, unknown,,,,,\nprint 'hello'\n-73728] _
source = "\nfrom __future__ import print_function, division, unknown,,,,,\nprint 'hello'\n"
result = 73728
    @pytest.mark.parametrize('source, result', [
        ('''
    from __future__ import print_function,
        division, with_statement,
        unicode_literals
    ''', 0x10000 | 0x2000 | 0x8000 | 0x20000),
        ('''
    from __future__ import print_function, division
    print('hello')
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import print_function, division, unknown,,,,,
    print 'hello'
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import (
        print_function,
        division)
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import \\
        print_function, \\
        division
    ''', 0x10000 | 0x2000),
    ])
    def test_parse_future(source, result):
        fp = BytesIO(source.encode('latin-1'))
        flags = parse_future_flags(fp)
>       assert flags == result
E       assert 1179648 == 73728
tests/test_util.py:96: AssertionError
_ test_parse_future[\nfrom __future__ import (\n    print_function,\n    division)\n-73728] _
source = '\nfrom __future__ import (\n    print_function,\n    division)\n'
result = 73728
    @pytest.mark.parametrize('source, result', [
        ('''
    from __future__ import print_function,
        division, with_statement,
        unicode_literals
    ''', 0x10000 | 0x2000 | 0x8000 | 0x20000),
        ('''
    from __future__ import print_function, division
    print('hello')
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import print_function, division, unknown,,,,,
    print 'hello'
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import (
        print_function,
        division)
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import \\
        print_function, \\
        division
    ''', 0x10000 | 0x2000),
    ])
    def test_parse_future(source, result):
        fp = BytesIO(source.encode('latin-1'))
        flags = parse_future_flags(fp)
>       assert flags == result
E       assert 1179648 == 73728
tests/test_util.py:96: AssertionError
_ test_parse_future[\nfrom __future__ import \\\n    print_function, \\\n    division\n-73728] _
source = '\nfrom __future__ import \\\n    print_function, \\\n    division\n'
result = 73728
    @pytest.mark.parametrize('source, result', [
        ('''
    from __future__ import print_function,
        division, with_statement,
        unicode_literals
    ''', 0x10000 | 0x2000 | 0x8000 | 0x20000),
        ('''
    from __future__ import print_function, division
    print('hello')
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import print_function, division, unknown,,,,,
    print 'hello'
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import (
        print_function,
        division)
    ''', 0x10000 | 0x2000),
        ('''
    from __future__ import \\
        print_function, \\
        division
    ''', 0x10000 | 0x2000),
    ])
    def test_parse_future(source, result):
        fp = BytesIO(source.encode('latin-1'))
        flags = parse_future_flags(fp)
>       assert flags == result
E       assert 1179648 == 73728
tests/test_util.py:96: AssertionError


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

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

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. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2020-05-04 18:21:15 UTC
babel is very early in the bootstrap sequence, raising severity.

Comment 2 Felix Schwarz 2020-05-04 20:06:14 UTC
I noticed at least one Python 3.9-related error when doing the setup procedure with an upstream git repo ("AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getiterator'") so I guess we need some fixes upstream.

I was a babel developer once but don't have that much time right now so I'd appreciate help.

@Nils: Do you have some cycles to check this out?

@Miro: This is the first time I became aware that Babel might be need changes for Python 3.9. Did I miss something?

Comment 3 Felix Schwarz 2020-05-04 20:14:36 UTC
I opened an upstream issue (https://github.com/python-babel/babel/issues/709) - maybe we get some attention to the problem. Still I can't promise a lot of work to debug this.

Comment 4 Miro Hrončok 2020-05-04 20:39:32 UTC
> @Miro: This is the first time I became aware that Babel might be need changes for Python 3.9. Did I miss something?

Not at all. https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/babel/ shows that it built pretty good so far.

Comment 5 Felix Schwarz 2020-05-04 20:58:49 UTC
I sent a pull request for the import problem (not related to Fedora's build failure but maybe helpful if you try to debug the issue): https://github.com/python-babel/babel/pull/710

Comment 6 Felix Schwarz 2020-05-04 21:15:44 UTC
probably not interesting but I wanted to add that babel 2.8.0 still works for me with Python 3.9 on Fedora 31. However you need "export TZ='UTC'" before running the test suite.

Comment 7 Felix Schwarz 2020-05-05 08:19:35 UTC
Actually this was not so hard to fix so I submitted a pull request upstream: https://github.com/python-babel/babel/pull/712

Until upstream fixes this properly I added a patch to the Fedora package in master. Please retest.

Comment 8 Miro Hrončok 2020-05-05 08:35:19 UTC
Your commit was automatically built in https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/babel/

Thank you.


Note You need to log in before you can comment on or make changes to this bug.