<div dir="ltr">I can confirm that the latest pyqt6 snapshots and CPython main branch work together.<div><br></div><div>Tom</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 16, 2023 at 10:36 AM Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 15/06/2023 19:03, Florian Bruhin wrote:<br>
> Hey,<br>
> <br>
>> When trying PyQt 6.5.1 with Python 3.12 Beta 2, something like:<br>
>> <br>
>>         import sys<br>
>>         from PyQt6.QtWidgets import QWidget, QApplication<br>
>> <br>
>>         class Mixin: pass<br>
>>         class Command(Mixin, QWidget): pass<br>
>> <br>
>>         app = QApplication(sys.argv)<br>
>>         cmd = Command()<br>
>>         cmd.show()<br>
>>         app.exec()<br>
>> <br>
>> segfaults here on the "cmd.Command()" line:<br>
>> <br>
>>         #0  [...] _PyDict_Next (op=0x0, [...])<br>
>>         [...]<br>
>>         #2  [...]  in trawl_hierarchy([...])<br>
>>            from .../lib/python3.12/site-packages/PyQt6/<a href="http://QtCore.abi3.so" rel="noreferrer" target="_blank">QtCore.abi3.so</a><br>
>>         [...]<br>
> <br>
> Eric Snow commented on the issue:<br>
> <br>
>     Presumably the crashing code is trying to use the dict returned by<br>
>     sipPyTypeDict() and I'm guessing that that function basically <br>
> returns<br>
>     pytype->tp_dict and that the pytype in question is a static builtin<br>
>     type. If that's the case then the failure makes sense since tp_dict <br>
> for<br>
>     static builtin types is now NULL.<br>
> <br>
> And that indeed seems to be the case: trawl_type does<br>
> "dict = sipPyTypeDict(pytype);", that is an alias to sip's<br>
> api_py_type_dict, and that accesses py_type->tp_dict.<br>
> <br>
> See:<br>
> <a href="https://github.com/python/cpython/issues/105227" rel="noreferrer" target="_blank">https://github.com/python/cpython/issues/105227</a><br>
> <br>
> There is now an open PR to add a PyType_GetDict():<br>
> <a href="https://github.com/python/cpython/pull/105747" rel="noreferrer" target="_blank">https://github.com/python/cpython/pull/105747</a><br>
<br>
Hopefully fixed in tonight's snapshot - although it needs the next beta <br>
release of Python v3.12 to build.<br>
<br>
Phil<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Thomas Caswell<br><a href="mailto:tcaswell@gmail.com" target="_blank">tcaswell@gmail.com</a></div>