Skip to content

4.1.0 includes unlisted breaking changes for sizer alignment flags  #1612

@chriskiehl

Description

@chriskiehl

Operating system: Win10 Pro v1903 OS build: 18362.778
wxPython version & source: 4.1.0 msw (phoenix)
Python version & source: 3.6.8 64 bit from python.org

Description of the problem:

The 4.1.0 includes an (unexpected?) breaking change that now throws errors for certain alignment flags. This causes applications to break when updating from 4.0.7 to 4.1.0.

I'm curious if this was a planned breakage? I've looked over the release notes, but I don't see anything specifically called out as such. Similarly, running with PYTHONWARNINGS=default on 4.0.x shows no relevant warnings in my code base for this specific issue.

The issue can be reproduced with the following code:

import wx

app = wx.App()

frame = wx.Frame(None, title='Simple application')
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(wx.StaticText(frame, -1, "foo"), 1, wx.ALIGN_CENTER_HORIZONTAL)

frame.Show()
app.MainLoop()

Traceback:

Traceback (most recent call last):
  File "Gooey/gooey/examples/wxissue.py", line 7, in <module>
    sizer.Add(wx.StaticText(frame, -1, "foo"), 1, wx.ALIGN_CENTER_HORIZONTAL)
wx._core.wxAssertionError: C++ assertion "!(flags & wxALIGN_CENTRE_HORIZONTAL)" failed at ..\..\src\common\sizer.cpp(2106) in wxBoxSizer::DoInsert(): Horizontal alignment flags are ignored in horizontal sizers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions