Files
python-wxPython/0004-Fix-time_t-ETG-typedef-extend-DateTime.FromTimeT-tes.patch
Jan Engelhardt 923808def3 - Update to version 4.2.3
* Fix test issues with wx.lib.introspect (#2717)
  * Add support for building on Windows ARM64 (#2521)
  * Incorporate many improvements to type stubs (#2665)
  * Fix building documentation with latest sphinx (#2672)
  * Build smaller architecture-specific wheels on macOS instead of large
    universal2 wheels
  * Calculate scroll based on child's relative position to scrolledpanel
    in wx.lib.scrolledpanel
  * Fix float -> int conversion issues in wx.lib.fancytext (#2703)
  * Replace deprecated NumPy type aliases
  * Use wx.StaticText in wx.lib.agw.hyperlink (#2686)
  * Implement partial support for pyproject.toml and other build process improvements
  * Remove use of six and most Python 2 compatibility code
  * Fix wxWidgets build on OpenSUSE (#558, #1067, #2422, #2532)
  * Fix more int conversions in wx.lib.agw.flatnotebook
  * Make build output reproducible
  * Enable overridding wx.Sizer.InformFirstDirection() (#2452)
  * Implement __iter__ for wxList iterator classes (fixes Python 3.13.1 issue)
  * Fix wx.lib.mixins.rubberband not clearing DC on redraw
  * Support implementing CreateBitmapBundle for custom ArtProvider
  * Fix float/int conversion issues in wx.lib.ogl
  * Include usage of wxMemoryFSHandler in webview demo
  * Fix crash when accessing wx.stc.StyledTextCtrl.DropTarget.Data (#2043)
  * Fix AuiManager pane minimizing issue
  * Add range field to wx.lib.agw.pygauge.PyGauge format string (#2583)
  * Fix pickling of wx.RealPoint (#2644)
  * Avoid calling FlatMenu Destroy() in a finally block (#2630)
  * Update wxApp.IsDisplayAvailable to work on Wayland
  * Fix InspectionTool crashes due to bad perspective string errors
  * Drop support for Python 3.8 (EOL)
  * Add CreateAccessible for Windows only
  * Added check condition to AuiManager LoadPerspective()
  * Fix RecursionError in platebtn bitmap getters
  * Add Python implementation of GetPaths (#1944)
  * Support Wayland GTK backend in Window.GetHandle
  * Refactor python only pdfviewer to support displaying pdf files where
    not all pages have the same size
  * Improve support when specifying a pre-existing toolbar as the target for
    the restore icon when minimizing a pane in agw.aui
  * Multiple bugfixes in pure python aui
  * pdfviewer: Add support for pymupdf renaming
- remove python-3.13.1.patch

OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/python-wxPython?expand=0&rev=71
2025-07-25 09:58:14 +00:00

53 lines
2.5 KiB
Diff

From 70ecc1afcdd59bbd3b700d000e8f92740d218245 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Tue, 28 Jun 2022 18:32:32 +0200
Subject: [PATCH 4/4] Fix time_t ETG typedef, extend DateTime.FromTimeT tests
Before c78823549bac ("Ensure time_t is treated as a 64-bit value by SIP")
the typedef used "long" instead of wxInt64, which caused issues on Win64,
as long is 32bit there (LLP64). On the other hand, wxInt64 is wrong on
32 bit Linux (e.g. armv7, i586), and thus the code crashes.
As SIP_SSIZE_T is 64 bit for both LLP64 (Windows) and LP64 (Linux), but
32 bit on 32bit archs, it matches time_t better (though, according to the
C standard, it could even be a double).
---
etg/defs.py | 2 +-
unittests/test_wxdatetime.py | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
Index: wxPython-4.2.2/etg/defs.py
===================================================================
--- wxPython-4.2.2.orig/etg/defs.py
+++ wxPython-4.2.2/etg/defs.py
@@ -73,7 +73,7 @@ def run():
td = module.find('wxUIntPtr')
module.insertItemAfter(td, etgtools.TypedefDef(type='wchar_t', name='wxUChar'))
module.insertItemAfter(td, etgtools.TypedefDef(type='wchar_t', name='wxChar'))
- module.insertItemAfter(td, etgtools.TypedefDef(type='wxInt64', name='time_t'))
+ module.insertItemAfter(td, etgtools.TypedefDef(type='long', name='time_t'))
module.insertItemAfter(td, etgtools.TypedefDef(type='long long', name='wxFileOffset'))
module.insertItemAfter(td, etgtools.TypedefDef(type='Py_ssize_t', name='ssize_t'))
module.insertItemAfter(td, etgtools.TypedefDef(type='unsigned char', name='byte', pyInt=True))
Index: wxPython-4.2.2/unittests/test_wxdatetime.py
===================================================================
--- wxPython-4.2.2.orig/unittests/test_wxdatetime.py
+++ wxPython-4.2.2/unittests/test_wxdatetime.py
@@ -25,9 +25,15 @@ class datetime_Tests(wtc.WidgetTestCase)
def test_datetime2(self):
d1 = wx.DateTime.FromHMS(8, 15, 45, 123)
d2 = wx.DateTime.FromJDN(12345.67)
- d3 = wx.DateTime.FromTimeT(int(time.time()))
d4 = wx.DateTime.FromDMY(1, wx.DateTime.Mar, 2012, 8, 15, 45, 123)
+ def test_datetimeTimeT(self):
+ d1 = wx.DateTime.FromTimeT(0)
+ self.assertEqual(d1.year, 1970)
+ d2 = wx.DateTime.FromTimeT(1643756400) # 2022-02-02
+ self.assertEqual(d2.year, 2022)
+ d3 = wx.DateTime.FromTimeT(int(time.time()))
+
def test_datetime3(self):
d1 = wx.DateTime.Today()
d2 = wx.DateTime.Now()