I'm trying to run the python3-fail2ban component built by yocto, but I'm encountering an error related to the PY_SSIZE_T_CLEAN macro. The error message is PY_SSIZE_T_CLEAN macro must be defined for '#' formats. I have no issues with 'python' dependent fail2ban, issues observed only with 'python3' dependent fail2ban I've looked into the issue and found that in the Python 3.10 C-API documentation https://docs.python.org/3.10/c-api/arg.html#arg-parsing, it's mentioned that, "Note: For all # variants of formats (s#, y#, etc.), the macro PY_SSIZE_T_CLEAN must be defined before including Python.h. On Python 3.9 and older, the type of the length argument is [Py_ssize_t] if the PY_SSIZE_T_CLEAN macro is defined, or int otherwise" I tried to resolve this issue by defining the PY_SSIZE_T_CLEAN macro before including Python.h. But the issue was not resolved, patch snippet here, +#ifndef PY_SSIZE_T_CLEAN +#define PY_SSIZE_T_CLEAN 1 +#endif #include "Python.h" Also included CFLAGS += "PY_SSIZE_T_CLEAN " in the python3-fail2ban component. No impact on observation -------Environment--------------------- *) Fail2Ban version : python3-fail2ban 0.11.2 : https://layers.openembedded.org/layerindex/recipe/304629/ *) OS, including release name/version : Linux built by yocto kirkstone (Yocto Project 4.0) *) Python dependency: python3 3.10.12 https://layers.openembedded.org/layerindex/recipe/300253/ *) poky version 4.0.4 *) No additional patches or changes *) No other customization ----------Steps to reproduce---------- 1. Created a jail /etc/fail2ban/jail.local with the below data, [sshd] enabled = yes port = ssh backend = systemd 2. restarted fail2ban services: sudo systemctl restart fail2ban.service 3. Relevant parts of /var/log/fail2ban.log file: fail2ban-server[11527]: fail2ban [11527]: ERROR NOK: ("PY_SSIZE_T_CLEAN macro must be defined for '#' formats",)
duplicate of https://bugzilla.yoctoproject.org/show_bug.cgi?id=15189 *** This bug has been marked as a duplicate of bug 15189 ***