Skip to content
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

DateTime limitation in version 4.2.2 #2713

Open
rogerlindberg opened this issue Mar 8, 2025 · 2 comments
Open

DateTime limitation in version 4.2.2 #2713

rogerlindberg opened this issue Mar 8, 2025 · 2 comments

Comments

@rogerlindberg
Copy link

Constructing a DateTime object with a year > 3001 fails with an assertion error.
This doesn't happen in version 4.2.1
(On windows. Both versions installed with pip.)

@swt2c
Copy link
Collaborator

swt2c commented Mar 9, 2025

Can you please provide a code snippet of exactly what you're doing?

For example, this works fine, on Linux at least:

>>> dt = wx.DateTime(1, 0, 4000)
>>> dt
<wx.DateTime: "Sat Jan  1 00:00:00 4000">

@rogerlindberg
Copy link
Author

This test runs ok! for me:

def test():
"""
>>> wx.VERSION
(4, 2, 2, '')

>>> dt = wx.DateTime(1, 0, 3001)
>>> dt
<wx.DateTime: "Thu Jan  1 00:00:00 3001">

>>> dt = wx.DateTime(31, 11, 3001)
>>> dt
<wx.DateTime: "INVALID">

>>> tm = wx.DateTime(1, 0, 3002)
>>> dt
<wx.DateTime: "INVALID">

>>> tm = wx.DateTime(1, 0, 4000)
>>> dt
<wx.DateTime: "INVALID">

"""
pass

It also produces a dialog box with description of the assertion error.

Image

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

No branches or pull requests

2 participants