<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error while running python3-fail2ban with &amp;quot;PY_SSIZE_T_CLEAN macro must be defined for '#' f in Other NXP Products</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/Error-while-running-python3-fail2ban-with-quot-PY-SSIZE-T-CLEAN/m-p/1701938#M18861</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209596"&gt;@zahir&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this can help you,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/fail2ban/fail2ban" target="_blank"&gt;https://github.com/fail2ban/fail2ban&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="https://salsa.debian.org/systemd-team/python-systemd/-/merge_requests/2" target="_blank"&gt;https://salsa.debian.org/systemd-team/python-systemd/-/merge_requests/2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://bugs.python.org/issue40943" target="_blank"&gt;https://bugs.python.org/issue40943&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/70705404/systemerror-py-ssize-t-clean-macro-must-be-defined-for-formats" target="_blank"&gt;https://stackoverflow.com/questions/70705404/systemerror-py-ssize-t-clean-macro-must-be-defined-for-formats&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Harvey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Aug 2023 12:34:44 GMT</pubDate>
    <dc:creator>Harvey021</dc:creator>
    <dc:date>2023-08-09T12:34:44Z</dc:date>
    <item>
      <title>Error while running python3-fail2ban with "PY_SSIZE_T_CLEAN macro must be defined for '#' formats"</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Error-while-running-python3-fail2ban-with-quot-PY-SSIZE-T-CLEAN/m-p/1700994#M18844</link>
      <description>&lt;P&gt;I'm trying to run the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;python3-fail2ban&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;component built by &lt;STRONG&gt;Yocto Kirkstone&lt;/STRONG&gt;, but I'm encountering an error related to the "PY_SSIZE_T_CLEAN macro". The error message is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;PY_SSIZE_T_CLEAN macro must be defined for '#' formats.&lt;/P&gt;&lt;P&gt;I've looked into the issue and found that in the Python 3.10 C-API documentation&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.python.org/3.10/c-api/arg.html#arg-parsing" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.python.org/3.10/c-api/arg.html#arg-parsing&lt;/A&gt;, it's mentioned that,&lt;/P&gt;&lt;P&gt;for all # variants of formats (like s#, y#, etc.), the PY_SSIZE_T_CLEAN macro must be defined before including Python.h. Additionally, it's stated that in 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.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;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,&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;+#ifndef PY_SSIZE_T_CLEAN&lt;BR /&gt;+#define PY_SSIZE_T_CLEAN 1&lt;BR /&gt;+#endif&lt;BR /&gt;#include "Python.h"&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Also included CFLAGS += "PY_SSIZE_T_CLEAN " in the python3-fail2ban component. No impact on observation&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Later, tried to add CFLAGS += "PY_SSIZE_T_CLEAN " in the python3 component directly, but it creates lots of build issues in yocto python3, seems like not recommended&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I'm using Yocto with a specific version of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;python3-fail2ban (0.11.2)&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;python3(10.12), and I've verified that the necessary&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;PY_SSIZE_T_CLEAN&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;macro is defined before including&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Python.h&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Despite this, the error persists. Has anyone encountered a similar issue when running&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;python3-fail2ban? Are there any additional steps or configurations that need to be done to properly include the PY_SSIZE_T_CLEAN macro? I'd appreciate any insights or suggestions to resolve this issue.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 09:33:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Error-while-running-python3-fail2ban-with-quot-PY-SSIZE-T-CLEAN/m-p/1700994#M18844</guid>
      <dc:creator>zahir</dc:creator>
      <dc:date>2023-08-08T09:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error while running python3-fail2ban with "PY_SSIZE_T_CLEAN macro must be defined for '#' f</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Error-while-running-python3-fail2ban-with-quot-PY-SSIZE-T-CLEAN/m-p/1701938#M18861</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209596"&gt;@zahir&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this can help you,&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/fail2ban/fail2ban" target="_blank"&gt;https://github.com/fail2ban/fail2ban&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="https://salsa.debian.org/systemd-team/python-systemd/-/merge_requests/2" target="_blank"&gt;https://salsa.debian.org/systemd-team/python-systemd/-/merge_requests/2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://bugs.python.org/issue40943" target="_blank"&gt;https://bugs.python.org/issue40943&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/70705404/systemerror-py-ssize-t-clean-macro-must-be-defined-for-formats" target="_blank"&gt;https://stackoverflow.com/questions/70705404/systemerror-py-ssize-t-clean-macro-must-be-defined-for-formats&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Harvey&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 12:34:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Error-while-running-python3-fail2ban-with-quot-PY-SSIZE-T-CLEAN/m-p/1701938#M18861</guid>
      <dc:creator>Harvey021</dc:creator>
      <dc:date>2023-08-09T12:34:44Z</dc:date>
    </item>
  </channel>
</rss>

