Repository navigation
Conversation
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.
Summary
tomlkit.date()currently accepts a local or offset timestamp and returns aDateTime, because Python'sdatetimesubclassesdate. Reject datetime values with the existing date-onlyValueError, preserving valid dates and the separatedatetime()factory.Adds regressions for local, UTC, and non-UTC offset timestamps. All three fail before the fix. The complete suite passes: 1,206 tests on Python 3.12.13, including the pinned toml-test submodule. All repository pre-commit hooks pass; the local pre-commit runner was upgraded because the declared 2.20 version cannot parse the current hook manifest's stage names. An installed-wheel consumer round-trips a real date/datetime TOML document through stdlib
tomlliband checks timestamp rejection. Other interpreter versions and upstream CI are not yet verified.The earlier #645 addressing this behavior was self-closed unmerged; this change was developed from the current factory and its date-only contract.
Agent Drafting Metadata
5ef0158and ran the seven date-related API tests, with no unresolved findings. This is automated review, not human maintainer review.