Bug 2062102 - python-css-parser fails to build with Python 3.11: AssertionError: Right exception, wrong message: got 'property 'literalname' of 'Property' object has no setter' instead of 'can't set attribute'
Summary: python-css-parser fails to build with Python 3.11: AssertionError: Right exc...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-css-parser
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Zbigniew Jędrzejewski-Szmek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2022-03-09 08:22 UTC by Tomáš Hrnčiar
Modified: 2022-06-08 20:51 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-05-21 15:48:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2022-03-09 08:22:08 UTC
python-css-parser fails to build with Python 3.11.0a5.

======================================================================
FAIL: test_specificity (css_parser_tests.test_selector.SelectorTestCase)
Selector.specificity
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/css-parser-1.0.7/css_parser_tests/basetest.py", line 155, in _assertRaisesMsgSubstring
    callableObj(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/css-parser-1.0.7/css_parser_tests/test_selector.py", line 414, in _set
    def _set(): selector.specificity = 1
                ^^^^^^^^^^^^^^^^^^^^
AttributeError: property 'specificity' of 'Selector' object has no setter

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/css-parser-1.0.7/css_parser_tests/test_selector.py", line 415, in test_specificity
    self.assertRaisesMsgSubstring(AttributeError, "can't set attribute", _set)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/css-parser-1.0.7/css_parser_tests/basetest.py", line 200, in assertRaisesMsgSubstring
    return self._assertRaisesMsgSubstring(excClass, msg, True, callableObj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/css-parser-1.0.7/css_parser_tests/basetest.py", line 166, in _assertRaisesMsgSubstring
    raise self.failureException(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Right exception, wrong message: got 'property 'specificity' of 'Selector' object has no setter' instead of 'can't set attribute'

======================================================================
FAIL: test_literalname (css_parser_tests.test_property.PropertyTestCase)
Property.literalname
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/css-parser-1.0.7/css_parser_tests/basetest.py", line 155, in _assertRaisesMsgSubstring
    callableObj(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: property 'literalname' of 'Property' object has no setter

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/css-parser-1.0.7/css_parser_tests/test_property.py", line 165, in test_literalname
    self.assertRaisesMsgSubstring(AttributeError, "can't set attribute", p.__setattr__,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/css-parser-1.0.7/css_parser_tests/basetest.py", line 200, in assertRaisesMsgSubstring
    return self._assertRaisesMsgSubstring(excClass, msg, True, callableObj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/css-parser-1.0.7/css_parser_tests/basetest.py", line 166, in _assertRaisesMsgSubstring
    raise self.failureException(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Right exception, wrong message: got 'property 'literalname' of 'Property' object has no setter' instead of 'can't set attribute'

----------------------------------------------------------------------
Ran 384 tests in 1.737s

FAILED (failures=2)

bpo-46730: Message of AttributeError caused by getting, setting or deleting a property without the corresponding function now mentions that the attribute is in fact a property and also specifies type of the class that it belongs to.

https://bugs.python.org/issue46730
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/03638665-python-css-parser/

For all our attempts to build python-css-parser with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-css-parser/

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

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
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 Zbigniew Jędrzejewski-Szmek 2022-05-21 12:38:42 UTC
Fix pushed to rawhide dist-git.

Comment 2 Zbigniew Jędrzejewski-Szmek 2022-05-21 15:48:27 UTC
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/build/4434580/ worked.

Comment 3 Jason R. Coombs 2022-06-08 20:51:24 UTC
The underlying issue is being addressed in [jaraco/cssutils#24](https://github.com/jaraco/cssutils/issues/24).


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