sip 6: handling of UTF-8 in Docstrings

Phil Thompson phil at riverbankcomputing.com
Wed Aug 4 18:03:34 BST 2021


On 03/08/2021 20:36, Scott Talbert wrote:
> Hi,
> 
> I encountered a strange problem after building wxPython with sip 6.
> When importing wxPython, I got this UnicodeDecodeError:
> 
> rawhide$ python -c "import wx;print(wx.version())"
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File "/usr/lib64/python3.10/site-packages/wx/__init__.py", line 17,
> in <module>
>     from wx.core import *
>   File "/usr/lib64/python3.10/site-packages/wx/core.py", line 12, in 
> <module>
>     from ._core import *
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position
> 261: invalid continuation byte
> free(): invalid size
> Aborted (core dumped)
> 
> Upon investigating further, it seems that the root cause is that there
> is a UTF-8 character in one of wxPython's docstrings and sip 6.1.1
> doesn't seem to handle this correctly, whereas sip 5.5.0 does.
> Attached is the .sip file as well as the .cpp files generated by both
> sip 5 and sip 6 so you can see the difference:
> 
> 3398c3183
> < "the wxListCtrl  it can be thought of as a façade for that 
> complicated\n"
> ---
>> "the wxListCtrl  it can be thought of as a fa\xffffffc3\xffffffa7ade 
>> for
> that complicated\n"

Should be fixed in the next snapshot. Patch attached.

Thanks,
Phil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sip.patch
Type: text/x-diff
Size: 468 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210804/96780e32/attachment.patch>


More information about the PyQt mailing list