Skip to content

wxpython 4.3.x compatibility for DisplayOptionsPanel.py - #1690

Merged
David-Baddeley merged 1 commit into
python-microscopy:masterfrom
barentine:wx4p3
Aug 6, 2026
Merged

wxpython 4.3.x compatibility for DisplayOptionsPanel.py#1690
David-Baddeley merged 1 commit into
python-microscopy:masterfrom
barentine:wx4p3

Conversation

@barentine

Copy link
Copy Markdown
Member

Currently PYMEImage -t fails to load on the new wxpython 4.3.1 release.

In wxpython 4.3 StaticBoxSizer parents are more strict, and at least warn with debug messages. We earn ourselves a debug message in DisplayOptionsPanel.py, but for some reason that debug call fails and we fail to open PYMEImage:

Traceback (most recent call last):
  File "/Users/andy/miniconda3/envs/wx4p3/lib/python3.12/site-packages/wx/core.py", line 3429, in <lambda>
    lambda event: event.callable(*event.args, **event.kw) )
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/andy/code/python-microscopy/PYME/DSView/dsviewer.py", line 475, in LoadData
    vframe = DSViewFrame(im, None, im.filename, mode = mode)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/andy/code/python-microscopy/PYME/DSView/dsviewer.py", line 161, in __init__
    self.optionspanel = OptionsPanel(self, self.do, thresholdControls=True)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/andy/code/python-microscopy/PYME/DSView/DisplayOptionsPanel.py", line 218, in __init__
    ssizer.Add(self.cbShowThreshold, 0, wx.ALL, 5)
wx._core.wxAssertionError: C++ assertion "Assert failure" failed at ./src/common/datetime.cpp(295) in wxCallStrftime(): strftime() failed

Fix is to make the static box the parent of the widgets, rather than the panel.
Tested fix on wxpython 4.3.1 and 4.2.5

…ise debug message internally calls strftime which currently crashes
@David-Baddeley
David-Baddeley merged commit e475220 into python-microscopy:master Aug 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants