sip 6.8.0+: AttributeError: 'WrappedClass' object has no attribute 'original_typedef'

Scott Talbert swt at techie.net
Fri Dec 8 00:57:18 GMT 2023


On Tue, 5 Dec 2023, Phil Thompson wrote:

>> Hi Phil,
>> 
>> Trying to build wxPython with sip 6.8.0+ (latest snapshot), I'm
>> running into this Traceback:
>> 
>> Generating the _propgrid bindings...
>> sip-build: An internal error occurred...
>> Traceback (most recent call last):
>>   File "/opt/hostedtoolcache/Python/3.12.0/x64/bin/sip-build", line 8,
>> in <module>
>>     sys.exit(main())
>>              ^^^^^^
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/tools/build.py",
>> line 37, in main
>>     handle_exception(e)
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/exceptions.py",
>> line 83, in handle_exception
>>     raise e
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/tools/build.py",
>> line 34, in main
>>     project.build()
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/project.py",
>> line 245, in build
>>     self.builder.build()
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/builder.py",
>> line 46, in build
>>     self._generate_bindings()
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/builder.py",
>> line 273, in _generate_bindings
>>     buildable = bindings.generate()
>>                 ^^^^^^^^^^^^^^^^^^^
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/bindings.py",
>> line 220, in generate
>>     output_code(spec, self, project, buildable)
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/generator/outputs/code.py",
>> line 60, in output_code
>>     _module_code(spec, bindings, project, py_debug, buildable)
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/generator/outputs/code.py",
>> line 512, in _module_code
>>     _virtual_handler(sf, spec, handler)
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/generator/outputs/code.py",
>> line 4530, in _virtual_handler
>>     sipres_value = _call_default_ctor(spec, ctor)
>>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/generator/outputs/code.py",
>> line 4254, in _call_default_ctor
>>     class_type = fmt_argument_as_cpp_type(spec, arg.definition)
>>                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>   File
>> "/opt/hostedtoolcache/Python/3.12.0/x64/lib/python3.12/site-packages/sipbuild/generator/outputs/formatters/argument.py",
>> line 46, in fmt_argument_as_cpp_type
>>     original_typedef = arg.original_typedef
>>                        ^^^^^^^^^^^^^^^^^^^^
>> AttributeError: 'WrappedClass' object has no attribute 'original_typedef'
>> Command 'sip-build --no-compile' failed with exit code 1.
>> 
>> 
>> Let me know if you need more details.
>> 
>> Thanks,
>> Scott
>
> The fix is probably to change 'arg.definition' to 'arg' in line 4254 of 
> code.py.
>
> Given the nature of the changes in v6.8 there are likely to be other minor 
> regressions. I'll release v6.8.1 when you are happy with it.

Thanks Phil, that fixed that error.  Now, when compiling, I'm seeing some 
broken code.  See the attached file on lines 203 and 214 where the if 
statement is not closed after the sipParsePair.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sip_corewxPyEvent.cpp
Type: text/x-c++src
Size: 11370 bytes
Desc: 
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20231207/eac904f3/attachment.cpp>


More information about the PyQt mailing list