Repository navigation
Address bugs reported in #3006 - #3007
Merged
Merged
Conversation
wx 3.3 made the propgrid flags scoped enums with bit operators, but sip makes scoped enums IntEnums, which reject any value that isn't one of their items. So when C++ called a Python override of ValueToString with FullValue | ValueIsCurrent, the conversion raised "ValueError: 65 is not a valid PGPropValFormatFlags" and the property's value silently became ''. Python code also couldn't pass a combination of these flags at all, since | returned an int. sip's BaseType=IntFlag annotation would be the natural fix, but it needs ABI 13, so add the missing behaviour to the enums from Python instead. Fixes part of wxWidgets#3006
wx.DateTime.ParseTime returns -1 on failure, which GetWxDateTime treated as success, so an invalid string silently became midnight rather than raising the documented ValueError. The check in the failure branch also used an undefined name, hidden by a bare except. SetParameters used min, max, limited and value without defining them unless they were passed in, and another bare except hid that too, so changing any parameter reset the control to midnight. SetMxDateTime and GetMxDateTime also used undefined names. Fixes part of wxWidgets#3006
SetAGWWindowStyleFlag checked ULC_HAS_VARIABLE_ROW_HEIGHT against the current style rather than the new one, so it rejected switching to report mode with that flag, and allowed leaving report mode with it. Sorting without a compare function used cmp(), which doesn't exist in Python 3. Fixes part of wxWidgets#3006
- Use open() rather than file(), and sys.exc_info() rather than sys.exc_value. - Replace cmp() and the removed wx.GetSingleChoiceIndex. - Read the modification date after setting the filename, so that the first save of a document works. - Fix undefined names in DocTemplate.SetIcon, DocManager.MakeFrameTitle, CreateView and the file history handlers, the missing self in DocMDIChildFrame.ProcessEvent, and the nonexistent GetViewTypeName. - Sort the view names along with the templates in SelectViewType. Fixes part of wxWidgets#3006
- infoframe: use wx.IsMainThread, wx.CallAfter rather than wx.MutexGuiLocker, and wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT. - buttonpanel: wx.NullFont rather than wx.NoneFont. - mixins.imagelist: wx.Icon and wx.Bitmap rather than the old Ptr classes, and ImageList.Add rather than AddIcon and AddWithColourMask. - py.frame: wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT. Fixes part of wxWidgets#3006
- dialogs.colourDialog: use the colour parameter. - intctrl: fix Cut with a selection, and define WXK_CTRL_C for macOS. - masked.maskededit: fix except e, unichr, and use Bind rather than the deprecated function-style event binders. - evtmgr: fix GetStats and GetDeadTopics, which used reduce and needed lists. - graphics: use the colours passed to the gradient brush methods, and wx.Colour rather than the deprecated wx.NamedColour. - floatcanvas BBox: fix RectBBox's constructor and PointInside. - pubsub: add the missing comma in pub.__all__, and raise the XML provider's exceptions through self. - py.sliceshell: fix Execute and OnShowCompHistory. - tools.dbg: fix IsEnabled and IsSuspended. Fixes part of wxWidgets#3006
…s slider Both passed floats that wx rejects with a TypeError: the editor when starting its scroll timer, and PyColourChooser when clicking an unused custom colour. Fixes part of wxWidgets#3006
- Menu.AppendSubMenu rather than Menu.Append with a submenu. - StyledTextEvent.GetString rather than GetText. - Event.is_set rather than isSet. - numpy's reshape rather than assigning to an array's shape. Fixes part of wxWidgets#3006
- ActiveXWrapper_Acrobat: wx.Platform rather than the undefined wxPlatform. - DVC_CustomRenderer: fix an undefined name in GetValue. - CustomTreeCtrl, HyperTreeList: remove wx.ALIGN_RIGHT from a horizontal sizer item, and replace wx.SystemSettings_GetFont and unichr. - SplitTree: wx.SystemSettings.GetColour rather than SystemSettings_GetColour. - PropertyGrid: GetAssertMode and wx.APP_ASSERT_EXCEPTION rather than the removed names. - PersistentControls: don't register a list control's internal windows. - Sound: wx.adv.Sound.CreateFromData rather than wx.SoundFromData. - Threads: stop the threads if the frame is destroyed without being closed. Fixes part of wxWidgets#3006
Under Python 3 these divisions give floats, which wx.Point, wx.Rect, wx.Colour, Window.Scroll and the DC drawing methods reject with a TypeError. - artmanager: the Office 2007 renderer's button, menu bar and toolbar backgrounds, PaintCrescentGradientBox, PaintDiagonalGradientBox and MixColours. MixColours is used for many of the AGW theme colours. - flatmenu: the renderer's scroll button and toolbar background. - flatnotebook: the tab navigator's panel. - toasterbox: CenterOnParent and CenterOnScreen. - ultimatelistctrl: GetLineCheckboxRect and ScrollList. - gridmovers: scrolling while dragging a row or column. - inspection: highlighting a wx.GridSizer. - shapedbutton: the rotated label of an SBitmapTextButton. - ribbon art_aui: the tab icon. - shortcuteditor, the RulerCtrl demo and the PixelBitmap sample: these only pass floats to methods that truncate them, but they are simple to correct. Fixes part of wxWidgets#3006
OGL keeps positions and sizes as floats, and most of its drawing already converts them, but shadows, line arrows and labels, branch attachments, divided shape dividers and a few metafile operations raised a TypeError. The polygon shadow also passed the y offset as a separate argument instead of adding it to the y position. Fixes part of wxWidgets#3006
An alignment in the direction a box sizer lays out in is ignored, as is any alignment combined with wx.EXPAND, and wx 3.3 raises an assertion for both. - balloontip: the close button of a tip without a title, which already has a stretching spacer before it. - pygauge: the sample at the end of the module. - The CustomTreeCtrl and HyperTreeList demos: the bitmaps in the tree buttons dialog. Also use an integer for the centred column header's position in the HyperTreeList demo. Fixes part of wxWidgets#3006
The shapedbutton tests need PIL and were skipped in every CI job, as nothing installed it.
Before Python 3.13, typing puts its io and re classes in sys.modules. Setting __debug__ in their read-only __dict__ raised a TypeError when writing to the output window and when closing it, which left the window open.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #NNNN