Bug 2322708 - weechat fails to build with Python 3.14: AttributeError: 'Constant' object has no attribute 's'
Summary: weechat fails to build with Python 3.14: AttributeError: 'Constant' object ha...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: weechat
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Paul P Komkoff Jr
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.14
TreeView+ depends on / blocked
 
Reported: 2024-10-30 11:28 UTC by Karolina Surma
Modified: 2024-12-01 23:16 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-12-01 23:16:16 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-10-30 11:28:58 UTC
weechat fails to build with Python 3.14.0a1.

1: TEST(Scripts, API)...
1: >>> Running command: /script load /builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/python/testapigen.py
1: python: loading script "/builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/python/testapigen.py"
1: python: registered script "testapigen", version 0.1 (Generate scripting API test scripts)
1: >>> Running command: /testapigen /builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/python/testapi.py ./tmp_weechat_test/testapi
1: =!= ERROR: 'Constant' object has no attribute 's'
1: 
1: Traceback (most recent call last):
1:   File "/builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/python/testapigen.py", line 359, in generate_scripts
1:     tests = get_tests(source_script)
1:   File "/builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/python/testapigen.py", line 347, in get_tests
1:     update_nodes(tests)
1:     ~~~~~~~~~~~~^^^^^^^
1:   File "/builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/python/testapigen.py", line 338, in update_nodes
1:     unparsed.add(node.args[0])
1:     ~~~~~~~~~~~~^^^^^^^^^^^^^^
1:   File "/builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/python/unparse.py", line 128, in add
1:     method(arg)
1:     ~~~~~~^^^^^
1:   File "/builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/python/unparse.py", line 197, in _ast_compare
1:     self.add(
1:     ~~~~~~~~^
1:         ' %s ' % self.cmpop[operator.__class__.__name__],
1:         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1:         comparator,
1:         ^^^^^^^^^^^
1:     )
1:     ^
1:   File "/builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/python/unparse.py", line 128, in add
1:     method(arg)
1:     ~~~~~~^^^^^
1:   File "/builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/python/unparse.py", line 204, in _ast_constant
1:     self.add(repr(node.s))
1:                   ^^^^^^
1: AttributeError: 'Constant' object has no attribute 's'
1: 
1: /builddir/build/BUILD/weechat-4.4.2-build/weechat-4.4.2/tests/scripts/test-scripts.cpp:204: error: Failure in TEST(Scripts, API)
1: 	LONGS_EQUAL(0, api_tests_errors) failed
1: 	expected <0 (0x0)>
1: 	but was  <1 (0x1)>
1: 
1:  - 52 ms


According to: https://docs.python.org/dev/whatsnew/3.14.html#id2

Remove the following classes. They were all deprecated since Python 3.8, and have emitted deprecation warnings since Python 3.12:
ast.Bytes
ast.Ellipsis
ast.NameConstant
ast.Num
ast.Str

Use ast.Constant instead. As a consequence of these removals, user-defined visit_Num, visit_Str, visit_Bytes, visit_NameConstant and visit_Ellipsis methods on custom ast.NodeVisitor subclasses will no longer be called when the NodeVisitor subclass is visiting an AST. Define a visit_Constant method instead.

Also, remove the following deprecated properties on ast.Constant, which were present for compatibility with the now-removed AST classes:
ast.Constant.n
ast.Constant.s

Use ast.Constant.value instead.
(Contributed by Alex Waygood in gh-119562.)


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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.14/fedora-rawhide-x86_64/08189240-weechat/

For all our attempts to build weechat with Python 3.14, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.14/package/weechat/

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

Let us know here if you have any questions.

Python 3.14 is planned to be included in Fedora 43.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.14.
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 Łukasz Patron 2024-11-04 17:53:42 UTC
This is addressed upstream and should be in the version that's getting released soon

[0] https://github.com/weechat/weechat/pull/2204
[1] https://weechat.org/news/138/20241117-Version-4.5.0/

Comment 2 Łukasz Patron 2024-12-01 23:16:16 UTC
The bugfix was backported to 4.4.4, which is available on rawhide.


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