Skip to content

Fix datetime last_modified rounding#13041

Open
nightcityblade wants to merge 1 commit into
aio-libs:3.14from
nightcityblade:fix/issue-5303
Open

Fix datetime last_modified rounding#13041
nightcityblade wants to merge 1 commit into
aio-libs:3.14from
nightcityblade:fix/issue-5303

Conversation

@nightcityblade

Copy link
Copy Markdown
Contributor

What do these changes do?

Makes StreamResponse.last_modified round datetime inputs the same way the numeric timestamp path already does, and adds a regression test for the sub-second case.

Are there changes in behavior for the user?

Yes. Datetime values with fractional seconds now round up consistently instead of truncating the fractional part.

Is it a substantial burden for the maintainers to support this?

No. This aligns two existing code paths that set the same header.

Related issue number

Fixes #5303

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
  • Add a new news fragment into the CHANGES/ folder

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label Jul 3, 2026
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.24%. Comparing base (6ae358f) to head (2bfc91e).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             3.14   #13041   +/-   ##
=======================================
  Coverage   98.24%   98.24%           
=======================================
  Files         135      135           
  Lines       48774    48779    +5     
  Branches     2613     2613           
=======================================
+ Hits        47916    47921    +5     
  Misses        678      678           
  Partials      180      180           
Flag Coverage Δ
CI-GHA 98.29% <100.00%> (+<0.01%) ⬆️
OS-Linux 98.06% <100.00%> (+<0.01%) ⬆️
OS-Windows 95.73% <100.00%> (-0.01%) ⬇️
OS-macOS 97.26% <100.00%> (+<0.01%) ⬆️
Py-3.10 97.45% <100.00%> (+<0.01%) ⬆️
Py-3.11 97.73% <100.00%> (+<0.01%) ⬆️
Py-3.12 97.81% <100.00%> (+<0.01%) ⬆️
Py-3.13 97.79% <100.00%> (+0.01%) ⬆️
Py-3.14 97.89% <100.00%> (-0.01%) ⬇️
Py-3.14t 96.89% <100.00%> (-0.01%) ⬇️
Py-pypy-3.11 96.74% <100.00%> (+<0.01%) ⬆️
VM-macos 97.26% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 98.06% <100.00%> (+<0.01%) ⬆️
VM-windows 95.73% <100.00%> (-0.01%) ⬇️
cython-coverage 38.47% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@codspeed-hq

codspeed-hq Bot commented Jul 3, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 72 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing nightcityblade:fix/issue-5303 (2bfc91e) with 3.14 (6ae358f)

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant