Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OverflowError when parsing a valid dateTime value #84

Open
StanimirIglev opened this issue Feb 5, 2025 · 0 comments
Open

OverflowError when parsing a valid dateTime value #84

StanimirIglev opened this issue Feb 5, 2025 · 0 comments

Comments

@StanimirIglev
Copy link

Description

When attempting to create a DateTime object for 9999-12-31T24:00:00, the library raises an OverflowError: date value out of range. According to the XML Schema 1.1. Part 2: Datatypes specification, '24:00:00' is a valid representation for midnight at the end of a day. Therefore, the DateTime class should accept 9999-12-31T24:00:00. The expected behavior would likely be to create a DateTime object for 10000-01-01T00:00:00, as it is semantically equivalent to 9999-12-31T24:00:00.

Steps to reproduce

>>> import elementpath
>>> elementpath.datatypes.DateTime(9999, 12, 31, 24, 00, 00)

Environment

  • Python Version: 3.13.0
  • elementpath Version: 4.7.0

Additional context

  • The bug was detected while trying to validate a document using the xmlschema library. Though it seems to stem from the elementpath's DateTime data type.

Please let me know if you need any further information. Thank you for looking into this!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant