Bug 2584220 - uwsgi fails to build with Python 3.16: Deprecated CAPI removals: Py_NoSiteFlag, Py_SetPythonHome, Py_SetProgramName, Py_OptimizeFlag, PySys_SetArgv
Summary: uwsgi fails to build with Python 3.16: Deprecated CAPI removals: Py_NoSiteFla...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: uwsgi
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ralf Ertzinger
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.16
TreeView+ depends on / blocked
 
Reported: 2026-11-25 15:37 UTC by Karolina Surma
Modified: 2026-11-25 15:37 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2026-11-25 15:37:42 UTC
uwsgi fails to build with Python 3.16.0a2.

+ /usr/bin/python3 uwsgiconfig.py --verbose --plugin plugins/python fedora python3
plugins/python/python_plugin.c:138:83: error: ‘Py_NoSiteFlag’ undeclared here (not in a function)
  138 |         {"no-site", no_argument, 0, "do not import site module", uwsgi_opt_true, &Py_NoSiteFlag, 0},
      |                                                                                   ^~~~~~~~~~~~~
plugins/python/python_plugin.c: In function ‘uwsgi_python_init’:
plugins/python/python_plugin.c:202:27: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  202 |         char *pyversion = strchr(Py_GetVersion(), '\n');
      |                           ^~~~~~
plugins/python/python_plugin.c:239:17: error: implicit declaration of function ‘Py_SetPythonHome’ [-Wimplicit-function-declaration]
  239 |                 Py_SetPythonHome(wpyhome);
      |                 ^~~~~~~~~~~~~~~~
plugins/python/python_plugin.c:263:9: error: implicit declaration of function ‘Py_SetProgramName’ [-Wimplicit-function-declaration]
  263 |         Py_SetProgramName(pname);
      |         ^~~~~~~~~~~~~~~~~
plugins/python/python_plugin.c:269:9: error: ‘Py_OptimizeFlag’ undeclared (first use in this function)
  269 |         Py_OptimizeFlag = up.optimize;
      |         ^~~~~~~~~~~~~~~
plugins/python/python_plugin.c:269:9: note: each undeclared identifier is reported only once for each function it appears in
plugins/python/pyutils.c: In function ‘init_pyargv’:
plugins/python/pyutils.c:391:9: error: implicit declaration of function ‘PySys_SetArgv’; did you mean ‘PySys_GetAttr’? [-Wimplicit-function-declaration]
  391 |         PySys_SetArgv(up.argc, up.py_argv);
      |         ^~~~~~~~~~~~~
      |         PySys_GetAttr


https://docs.python.org/3.16/whatsnew/3.16.html:
Remove 21 global configuration variables, deprecated in Python 3.12. To initialize Python, the PyInitConfig C API can be used instead. To read these variables at runtime, PyConfig_Get() can be used instead. Removed variables with their PyInitConfig C API and PyConfig_Get() replacement:

    Py_DebugFlag: Use "parser_debug" instead.

    Py_VerboseFlag: Use "verbose" instead.

    Py_QuietFlag: Use "quiet" instead.

    Py_InteractiveFlag: Use "interactive" instead.

    Py_InspectFlag: Use "inspect" instead.

    Py_OptimizeFlag: Use "optimization_level" instead.

    Py_NoSiteFlag: Use "site_import" instead (opposite value).

    Py_BytesWarningFlag: Use "bytes_warning" instead.

    Py_FrozenFlag: Use "pathconfig_warnings" instead (opposite value).

    Py_IgnoreEnvironmentFlag: Use "use_environment" instead (opposite value).

    Py_DontWriteBytecodeFlag: Use "write_bytecode" instead (opposite value).

    Py_NoUserSiteDirectory: Use "user_site_directory" instead (opposite value).

    Py_UnbufferedStdioFlag: Use "buffered_stdio" instead (opposite value).

    Py_HashRandomizationFlag: Use "hash_seed" instead.

    Py_IsolatedFlag: Use "isolated" instead.

    Py_LegacyWindowsFSEncodingFlag: Use "legacy_windows_fs_encoding" instead.

    Py_LegacyWindowsStdioFlag: Use "legacy_windows_stdio" instead.

    Py_FileSystemDefaultEncoding, Py_HasFileSystemDefaultEncoding: Use "filesystem_encoding" instead.

    Py_FileSystemDefaultEncodeErrors: Use "filesystem_errors" instead.

    Py_UTF8Mode: Use "utf8_mode" instead.

(Contributed by Victor Stinner in gh-158001.)

Remove Py_SetProgramName() and Py_SetPythonHome() functions, deprecated since Python 3.11. Instead, use PyInitConfig C API to set respectively "program_name" and "home". (Contributed by Victor Stinner in gh-158001.)

Remove PySys_SetArgv() and PySys_SetArgvEx() functions, deprecated since Python 3.11. Instead, set directly sys.argv, and maybe also sys.path. (Contributed by Victor Stinner in gh-158001.)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.16/fedora-rawhide-x86_64/11359741-uwsgi/

For all our attempts to build uwsgi with Python 3.16, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.16/package/uwsgi/

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

Let us know here if you have any questions.

Python 3.16 is planned to be included in Fedora 47.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.16.
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.


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