aiohttp icon indicating copy to clipboard operation
aiohttp copied to clipboard

Revisit last_modified in StreamResponse

Open greshilov opened this issue 5 years ago • 3 comments

What do these changes do?

Bug fixes related to last_modified attribute in StreamResponse object.

Are there changes in behavior for the user?

Nope.

Related issue number

#5303, #5304

Checklist

  • [x] I think the code is well written
  • [x] Unit tests for the changes exist
  • [x] Documentation reflects the changes
  • [x] If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • [x] Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

greshilov avatar Dec 06 '20 14:12 greshilov

Codecov Report

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

Project coverage is 97.15%. Comparing base (4121c94) to head (a7072ec). Report is 4152 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5313      +/-   ##
==========================================
- Coverage   97.16%   97.15%   -0.02%     
==========================================
  Files          41       41              
  Lines        8739     8742       +3     
  Branches     1402     1403       +1     
==========================================
+ Hits         8491     8493       +2     
  Misses        129      129              
- Partials      119      120       +1     
Flag Coverage Δ
unit 97.03% <100.00%> (-0.02%) :arrow_down:

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

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

codecov[bot] avatar Dec 06 '20 14:12 codecov[bot]

I know, the change is not backward compatible but I don't see a smooth transition. @serhiy-storchaka what do you think?

asvetlov avatar Dec 06 '20 16:12 asvetlov

To make the change more gradual we would need to emit FutureWarning, and change the behavior only after passing some period (a year or two). But if most of uses of naive datetime objects are datetime.now() this change will actually fix currently broken user code.

serhiy-storchaka avatar Dec 08 '20 09:12 serhiy-storchaka