Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1831248 - pyflakes fails to build with Python 3.9: Exceptions output has changed
Summary: pyflakes fails to build with Python 3.9: Exceptions output has changed
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pyflakes
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1841662 (view as bug list)
Depends On:
Blocks: PYTHON39
TreeView+ depends on / blocked
 
Reported: 2020-05-04 18:18 UTC by Miro Hrončok
Modified: 2020-06-11 11:48 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-11 11:48:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github PyCQA pyflakes issues 549 0 None open Test failures with Python 3.9.0b1 2020-06-10 12:01:51 UTC

Description Miro Hrončok 2020-05-04 18:18:31 UTC
pyflakes fails to build with Python 3.9.0a6.

======================================================================
FAIL: test_syntaxErrorInDoctest (pyflakes.test.test_doctests.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_doctests.py", line 344, in test_syntaxErrorInDoctest
    self.assertEqual(exc.col, 16)
AssertionError: 13 != 16

======================================================================
FAIL: test_eofSyntaxError (pyflakes.test.test_api.CheckTests)
The error reported for source files which end prematurely causing a
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_api.py", line 458, in test_eofSyntaxError
    self.assertHasErrors(
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_api.py", line 354, in assertHasErrors
    self.assertEqual(
AssertionError: Tuples differ: (1, '/tmp/tmpc2pmijj_:1:1: unexpected EOF while parsing\ndef foo(\n^\n') != (1, '/tmp/tmpc2pmijj_:1:9: unexpected EOF while parsing\ndef foo(\n        ^\n')

First differing element 1:
'/tmp/tmpc2pmijj_:1:1: unexpected EOF while parsing\ndef foo(\n^\n'
'/tmp/tmpc2pmijj_:1:9: unexpected EOF while parsing\ndef foo(\n        ^\n'

- (1, '/tmp/tmpc2pmijj_:1:1: unexpected EOF while parsing\ndef foo(\n^\n')
?                         ^

+ (1, '/tmp/tmpc2pmijj_:1:9: unexpected EOF while parsing\ndef foo(\n        ^\n')
?                         ^                                          ++++++++


======================================================================
FAIL: test_invalidEscape (pyflakes.test.test_api.CheckTests)
The invalid escape syntax raises ValueError in Python 2
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_api.py", line 562, in test_invalidEscape
    self.assertHasErrors(
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_api.py", line 354, in assertHasErrors
    self.assertEqual(
AssertionError: Tuples differ: (1, "[14 chars]75:1:13: (unicode error) 'unicodeescape' codec[88 chars]^\n") != (1, "[14 chars]75:1:7: (unicode error) 'unicodeescape' codec [81 chars]^\n")

First differing element 1:
"/tmp/tmpow81xd75:1:13: (unicode error) 'unicodeescape' codec[87 chars] ^\n"
"/tmp/tmpow81xd75:1:7: (unicode error) 'unicodeescape' codec [80 chars] ^\n"

  (1,
-  "/tmp/tmpow81xd75:1:13: (unicode error) 'unicodeescape' codec can't decode "
?                      ^^

+  "/tmp/tmpow81xd75:1:7: (unicode error) 'unicodeescape' codec can't decode "
?                      ^

   'bytes in position 0-1: truncated \\xXX escape\n'
   "foo = '\\xyz'\n"
-  '            ^\n')
?   ------

+  '      ^\n')

======================================================================
FAIL: test_multilineSyntaxError (pyflakes.test.test_api.CheckTests)
Source which includes a syntax error which results in the raised
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_api.py", line 416, in test_multilineSyntaxError
    evaluate(source)
  File "<string>", line 8
    '''
      ^
SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_api.py", line 420, in test_multilineSyntaxError
    self.assertTrue(e.text.count('\n') > 1)
AssertionError: False is not true

======================================================================
FAIL: test_nonDefaultFollowsDefaultSyntaxError (pyflakes.test.test_api.CheckTests)
Source which has a non-default argument following a default argument
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_api.py", line 496, in test_nonDefaultFollowsDefaultSyntaxError
    self.assertHasErrors(
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_api.py", line 354, in assertHasErrors
    self.assertEqual(
AssertionError: Tuples differ: (1, '[14 chars]d4:1:21: non-default argument follows default [54 chars]^\n') != (1, '[14 chars]d4:1:9: non-default argument follows default a[41 chars]^\n')

First differing element 1:
'/tmp/tmpp8mb5td4:1:21: non-default argument follows default [53 chars] ^\n'
'/tmp/tmpp8mb5td4:1:9: non-default argument follows default a[40 chars] ^\n'

  (1,
-  '/tmp/tmpp8mb5td4:1:21: non-default argument follows default argument\n'
?                      ^^

+  '/tmp/tmpp8mb5td4:1:9: non-default argument follows default argument\n'
?                      ^

   'def foo(bar=baz, bax):\n'
-  '                    ^\n')
+  '        ^\n')

======================================================================
FAIL: test_nonKeywordAfterKeywordSyntaxError (pyflakes.test.test_api.CheckTests)
Source which has a non-keyword argument after a keyword argument should
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_api.py", line 525, in test_nonKeywordAfterKeywordSyntaxError
    self.assertHasErrors(
  File "/builddir/build/BUILD/pyflakes-2.1.1/pyflakes/test/test_api.py", line 354, in assertHasErrors
    self.assertEqual(
AssertionError: Tuples differ: (1, '[15 chars]0:1:17: positional argument follows keyword ar[43 chars]^\n') != (1, '[15 chars]0:1:14: positional argument follows keyword ar[40 chars]^\n')

First differing element 1:
'/tmp/tmp4p5fenu0:1:17: positional argument follows keyword ar[42 chars] ^\n'
'/tmp/tmp4p5fenu0:1:14: positional argument follows keyword ar[39 chars] ^\n'

  (1,
-  '/tmp/tmp4p5fenu0:1:17: positional argument follows keyword argument\n'
?                       ^

+  '/tmp/tmp4p5fenu0:1:14: positional argument follows keyword argument\n'
?                       ^

   'foo(bar=baz, bax)\n'
-  '                ^\n')
?   ---

+  '             ^\n')

----------------------------------------------------------------------
Ran 701 tests in 1.546s

FAILED (failures=6, skipped=34)

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

For all our attempts to build pyflakes with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/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.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-11 11:25:24 UTC
This is only severe because pycurl needs pyflakes. That can be changed: https://src.fedoraproject.org/rpms/python-pycurl/pull-request/3

Comment 2 Miro Hrončok 2020-05-25 13:02:01 UTC
This comment is mass posted to all bugs blocking the Python 3.9 tracker, sorry if it is not 100 % relevant. When in doubt, please ask.


The Python 3.9 rebuild is in progress in a Koji side tag.

If you fix this bug, please don't rebuild the package in regular rawhide, but do it in the side tag with:

    $ fedpkg build --target=f33-python

The rebuild is progressing slowly and it is possible this package won't have all the required build dependencies yet. If that's the case, please just leave the fix committed and pushed and we will eventually rebuild it for you.

You are not asked to go and try rebuild all the missing dependencies yourself. If you know there is a bootstrap loop in the dependencies, let me know and we can untangle it together.

If you want to test your fix or reproduce the failure, you can still use the Copr repo mentioned in the initial comment of this bug: https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Comment 3 Miro Hrončok 2020-05-29 07:11:54 UTC
Python 3.9 update: The f33-python side tag is currently being merged.

New builds in f33-python are no longer possible, but python3 is not yet updated to Python 3.9 in rawhide. You can check when Python is Python 3.9 with:

    $ koji wait-repo f33-build --build python3.9-3.9.0~b1-3.fc3

And build the packages normally after that.

Comment 4 Miro Hrončok 2020-05-29 16:06:45 UTC
*** Bug 1841662 has been marked as a duplicate of this bug. ***

Comment 5 Sandro Bonazzola 2020-05-29 16:22:04 UTC
I've no capacity for handling this in a short loop, help on this will be appreciated.

Comment 7 Miro Hrončok 2020-05-29 21:29:38 UTC
Any package buildrequiring pyflakes/flake8 just to lint the code in %check may just stop doing that. I can help.

Comment 8 Miro Hrončok 2020-05-31 22:41:48 UTC
Upstream report: https://github.com/PyCQA/pyflakes/issues/549

I'm going to skip the few affected test for now to unblock others.

Comment 10 Miro Hrončok 2020-05-31 23:02:56 UTC
Note: Some of these were bugs in cpython introduced by the PEG parser: https://bugs.python.org/issue40334

Comment 11 Sandro Bonazzola 2020-06-01 09:29:31 UTC
(In reply to Miro Hrončok from comment #9)
> https://src.fedoraproject.org/rpms/pyflakes/pull-request/10

This has been merged

Comment 12 Miro Hrončok 2020-06-01 09:30:48 UTC
The package built. Keeping this open to track the workaround.

Comment 14 Miro Hrončok 2020-06-01 10:39:20 UTC
(In reply to Igor Raits from comment #13)
> Hello,
> 
> This is the first reminder (step 3 from
> https://docs.fedoraproject.org/en-US/fesco/
> Fails_to_build_from_source_Fails_to_install/
> #_package_removal_for_long_standing_ftbfs_and_fti_bugs).

I've reported this comment as bogus to Igor.

Comment 15 Miro Hrončok 2020-06-11 11:48:15 UTC
This is a bulk close of Python 3.9 bugzillas of packages that successfully built.
If this remained open for a reason, I am sorry and feel free to reopen.


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