New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4.1.1: Crash in wx.Region(points) constructor on MacOS #1878
Comments
Reproduced, not just a problem on macOS. I think I actually broke this myself. I'll send a fix soon. |
When I added this code in 5e190eb, it was intended to be used in all cases except for constructors and destructors. Instead, it was used in all cases. This broke the wxRegion constructor and possibly other things. Fixes wxWidgets#1878.
This code snippet in the OP still fails, but I'm not sure I can say which is wrong. 4.1.0 for allowing it to work, or 4.1.1 for failing. Anyway, I expect that what is happening is that an unexpected overload is being chosen for
However, if you are more specific in what is being passed for the args then it works fine. For example, unpacking
Or creating an actual wx.Rect works too:
|
The ZetCode tutorial creates a star-shaped clipping region, using... points = [(0, 85), (75, 75), (100, 10), (125, 75), (200, 85),
(150, 125), (160, 190), (100, 150), (40, 190), (50, 125)]
region = wx.Region(points) The work-around of expanding the list using |
I'm hitting this as well on macOS, with wxpython 4.1.1 installed from conda-forge, via some code in
|
@RobinD42 Could you please remind us why you reopen the issue after the fix, which seems to solve the problem? I was exposed to this crash on Windows and did these modifications (put in comments):
wxPython-4.1.1\sip\gen\region.sip (not sure if it's really necessary)
And after a new build from sources, it works:
|
The crash is a regression between 4.1.0 -> 4.1.1, as demonstrated by the sequence of commands below:
python -c "import wx; import sys; p=[(0,0), (10,10)]; r=wx.Region(p);"
causes the crash with 4.1.1, but runs fine once 4.1.0 is installed.The text was updated successfully, but these errors were encountered: