falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.53k stars 945 forks source link

feat(misc): return timezone aware datetime objects #2246

Closed chgad closed 2 months ago

chgad commented 4 months ago

let http_date_to_dt validate timezone information from the provided http-date and return timezone aware datetime objects remove tests for timezone naive variants amend tests

Breaks any application relying on naiveness of datetimes or interpretation in local time. Closes https://github.com/falconry/falcon/issues/2182

Summary of Changes

Make the function http_date_to_dt validate timezone inforamtion of a http-date and return timezone aware datetime objects.

Related Issues

2182

Pull Request Checklist

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

PR template inspired by the attrs project.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (321bda1) to head (db6fe41). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2246 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 63 63 Lines 7329 7335 +6 Branches 1276 1277 +1 ========================================= + Hits 7329 7335 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.