assemble_changelog.py: Clean up datetime.fromtimestamp timezone handling#174
Open
gilles-peskine-arm wants to merge 1 commit intoMbed-TLS:mainfrom
Open
Conversation
Replace `datetime.datetime.utcfromtimestamp`, which is deprecated since Python 3.12, by `datetime.datetime.fromtimestamp` on `datetime.timezone.utc`, which has existed since Python 3.2. Also fix file timestamps, which were in the local time zone rather than UTC. This had no practical consequence since the script only uses those timestamps to compare with other file timestamps. (In particular, all uncommitted files are ordered after all committed files, so the script never compares a formerly-UTC timestamp of a committed file to a formerly-local timestamp of an uncommitted file.) Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
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.
Get rid of harmless warnings when you run
assemble_changelog.pywith Python ≥3.12. We're using a deprecated functiondatetime.datetime.utcfromtimestamp, but we happen to be using it safely, and at the time of posting the function hasn't been removed yet.This is the only script where we use
datetime.datetime.utcfromtimestamp.PR checklist