weechat fails to run with python dataclasses
LorenzoBianconi opened this issue · comments
Describe the bug
weechat is currently failing whenever tries to run any python program with dataclasses support
Steps to reproduce
it is enough to run the following python script:
$ cat .weechat/python/t.py
from dataclasses import dataclass
@DataClass
class lol:
a: int
lol(a=3)
$ ./weechat -d ~/.weechat/ -r '/script load t.py'
Current behavior
python: loading script "/home/lorenzo/.weechat/python/t.py"
python: stdout/stderr (?): Traceback (most recent call last):
python: stdout/stderr (?): File "/home/lorenzo/.weechat/python/t.py", line 7, in
python: stdout/stderr (?): lol(a=3)
python: stdout/stderr (?): TypeError: lol() takes no arguments
python: unable to parse file "/home/lorenzo/.weechat/python/t.py"
Expected behavior
properly run the script
Suggested solutions
No response
Additional information
No response
WeeChat version
4.1.2 and 4.2.0-dev
What OS are you using?
fedora39
On which terminal are you running WeeChat?
konsole
Which terminal multiplexer are you using?
tmux
Looks like this is an upstream bug in cpython. It's fixed in Python 3.12.1. See:
python/cpython#110279
https://bugzilla.redhat.com/show_bug.cgi?id=2252567
I confirmed that I get the same error in Fedora 39, and that it's fixed after I run dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-c209acd8a1
to upgrade to Python 3.12.1.
I'm closing as it's a Python issue.