On upgrading from F38 to F39, all Flask apps fail this way: [Sat Dec 02 15:47:16.161715 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] mod_wsgi (pid=1196): Exception occurred processing WSGI script '/home/site/dmnes-site/viewer.wsgi'. [Sat Dec 02 15:47:16.162222 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] Traceback (most recent call last): [Sat Dec 02 15:47:16.162680 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] File "/home/site/dmnes-site/viewer.wsgi", line 7, in <module> [Sat Dec 02 15:47:16.162693 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] from viewer import app as application [Sat Dec 02 15:47:16.162705 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] File "/home/site/dmnes-site/viewer.py", line 20, in <module> [Sat Dec 02 15:47:16.162709 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] app = Flask(__name__) [Sat Dec 02 15:47:16.162713 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] ^^^^^^^^^^^^^^^ [Sat Dec 02 15:47:16.162722 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] File "/usr/lib/python3.12/site-packages/flask/app.py", line 709, in __init__ [Sat Dec 02 15:47:16.162726 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] self.add_url_rule( [Sat Dec 02 15:47:16.162735 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] File "/usr/lib/python3.12/site-packages/flask/scaffold.py", line 50, in wrapper_func [Sat Dec 02 15:47:16.162739 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] return f(self, *args, **kwargs) [Sat Dec 02 15:47:16.162772 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] ^^^^^^^^^^^^^^^^^^^^^^^^ [Sat Dec 02 15:47:16.162781 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] File "/usr/lib/python3.12/site-packages/flask/app.py", line 1357, in add_url_rule [Sat Dec 02 15:47:16.162785 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] self.url_map.add(rule) [Sat Dec 02 15:47:16.162794 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] File "/usr/lib/python3.12/site-packages/werkzeug/routing/map.py", line 174, in add [Sat Dec 02 15:47:16.162797 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] rule.bind(self) [Sat Dec 02 15:47:16.162805 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] File "/usr/lib/python3.12/site-packages/werkzeug/routing/rules.py", line 560, in bind [Sat Dec 02 15:47:16.162809 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] self.compile() [Sat Dec 02 15:47:16.162817 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] File "/usr/lib/python3.12/site-packages/werkzeug/routing/rules.py", line 688, in compile [Sat Dec 02 15:47:16.162821 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] RulePart( [Sat Dec 02 15:47:16.162837 2023] [wsgi:error] [pid 1196:tid 1590] [remote 92.25.120.97:49430] TypeError: RulePart() takes no arguments Reproducible: Always Steps to Reproduce: 1. Send HTTP GET to Flask app Actual Results: Error, as above. Expected Results: Page is served successfully. The error happens on a @dataclass in werkzeug. Apparently Python 3.12.0 has broken initialization of dataclasses in subinterpreters, as detailed here: https://github.com/python/cpython/issues/110279 The bug is already fixed, so only needs to be packaged. There's no workaround available in the meantime---we can't go back to Python 3.11 because mod_wsgi can't be used with any version of Python other than the one it was compiled for.
https://src.fedoraproject.org/rpms/python3.12/pull-request/89 https://src.fedoraproject.org/rpms/python3.12/pull-request/90
Joel, are you able to test the build and verify the fix? dnf upgrade https://kojipkgs.fedoraproject.org/work/tasks/753/109940753/python3-libs-3.12.0-3.fc39.x86_64.rpm https://kojipkgs.fedoraproject.org/work/tasks/753/109940753/python3-3.12.0-3.fc39.x86_64.rpm (add more subpackages if you have them installed)
Thanks for pursuing this promptly. I ought to be able to try it and report back tomorrow.
I've tested the build with a minimal Flask app and can confirm that with python3 3.12.0-1, I get the error as reported, and with the builds the app works correctly with no errors. Thanks very much for fixing this problem! Here's my minimal test case, if you're interested: app.py: ``` from flask import Flask app = Flask(__name__) @app.route('/') def front() return "hey" ``` app.wsgi: ``` import os import sys sys.path.append(os.path.dirname(__file__)) from app import app as application ``` Apache conf: ``` WSGIDaemonProcess app WSGIScriptAlias /app /var/www/html/app.wsgi ```
FEDORA-2023-c209acd8a1 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-c209acd8a1
FEDORA-2023-c209acd8a1 has been pushed to the Fedora 39 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-c209acd8a1` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-c209acd8a1 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2023-c209acd8a1 has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report.