Bug 2279989 - pyflakes fails to build with Python 3.13: AssertionError: Tuples differ: ('', "/tmp/tmph2zjmdt6/temp:1:7: Expected one [47 chars]", 1) != ('', '/tmp/tmph2zjmdt6/temp:1:7: invalid synta[20 chars]', 1)
Summary: pyflakes fails to build with Python 3.13: AssertionError: Tuples differ: ('',...
Keywords:
Status: CLOSED COMPLETED
Alias: None
Product: Fedora
Classification: Fedora
Component: pyflakes
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ali Erdinc Koroglu
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-05-10 12:07 UTC by Karolina Surma
Modified: 2024-09-04 16:07 UTC (History)
5 users (show)

Fixed In Version: pyflakes-3.1.0-2.fc41
Clone Of:
Environment:
Last Closed: 2024-09-04 16:07:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-05-10 12:07:05 UTC
pyflakes fails to build with Python 3.13.0b1.

=================================== FAILURES ===================================
_____________________ IntegrationTests.test_errors_syntax ______________________

self = <pyflakes.test.test_api.IntegrationTests testMethod=test_errors_syntax>

    def test_errors_syntax(self):
        """
        When pyflakes finds errors with the files it's given, (if they don't
        exist, say), then the return code is non-zero and the errors are
        printed to stderr.
        """
        with open(self.tempfilepath, 'wb') as fd:
            fd.write(b"import")
        d = self.runPyflakes([self.tempfilepath])
        error_msg = '{0}:1:7: invalid syntax{1}import{1}      ^{1}'.format(
            self.tempfilepath, os.linesep)
>       self.assertEqual(d, ('', error_msg, 1))
E       AssertionError: Tuples differ: ('', "/tmp/tmpwh8ow2pz/temp:1:7: Expected one [47 chars]", 1) != ('', '/tmp/tmpwh8ow2pz/temp:1:7: invalid synta[20 chars]', 1)
E       
E       First differing element 1:
E       "/tmp/tmpwh8ow2pz/temp:1:7: Expected one [43 chars] ^\n"
E       '/tmp/tmpwh8ow2pz/temp:1:7: invalid synta[16 chars] ^\n'
E       
E       + ('', '/tmp/tmpwh8ow2pz/temp:1:7: invalid syntax\nimport\n      ^\n', 1)
E       - ('',
E       -  "/tmp/tmpwh8ow2pz/temp:1:7: Expected one or more names after 'import'\n"
E       -  'import\n'
E       -  '      ^\n',
E       -  1)

pyflakes/test/test_api.py:779: AssertionError
_________________________ TestMain.test_errors_syntax __________________________

self = <pyflakes.test.test_api.TestMain testMethod=test_errors_syntax>

    def test_errors_syntax(self):
        """
        When pyflakes finds errors with the files it's given, (if they don't
        exist, say), then the return code is non-zero and the errors are
        printed to stderr.
        """
        with open(self.tempfilepath, 'wb') as fd:
            fd.write(b"import")
        d = self.runPyflakes([self.tempfilepath])
        error_msg = '{0}:1:7: invalid syntax{1}import{1}      ^{1}'.format(
            self.tempfilepath, os.linesep)
>       self.assertEqual(d, ('', error_msg, 1))
E       AssertionError: Tuples differ: ('', "/tmp/tmph2zjmdt6/temp:1:7: Expected one [47 chars]", 1) != ('', '/tmp/tmph2zjmdt6/temp:1:7: invalid synta[20 chars]', 1)
E       
E       First differing element 1:
E       "/tmp/tmph2zjmdt6/temp:1:7: Expected one [43 chars] ^\n"
E       '/tmp/tmph2zjmdt6/temp:1:7: invalid synta[16 chars] ^\n'
E       
E       + ('', '/tmp/tmph2zjmdt6/temp:1:7: invalid syntax\nimport\n      ^\n', 1)
E       - ('',
E       -  "/tmp/tmph2zjmdt6/temp:1:7: Expected one or more names after 'import'\n"
E       -  'import\n'
E       -  '      ^\n',
E       -  1)

pyflakes/test/test_api.py:779: AssertionError
=========================== short test summary info ============================
FAILED pyflakes/test/test_api.py::IntegrationTests::test_errors_syntax - Asse...
FAILED pyflakes/test/test_api.py::TestMain::test_errors_syntax - AssertionErr...
================== 2 failed, 712 passed, 14 skipped in 1.52s ===================

https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/07433947-pyflakes/

For all our attempts to build pyflakes with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/pyflakes/

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.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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.


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