-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(5925): suppress ValueError due to invalid datetime header #6012
fix(5925): suppress ValueError due to invalid datetime header #6012
Conversation
966e14b
to
a43b53b
Compare
I wonder if it's the docs that should be updated. Have you checked if the code changed at some point w/o updating the docs? Merging such a change in a minor release may be dangerous for people relying on the de-facto behavior. Plus raising an exception is more pythonic. |
@webknjaz Thanks for the feedback!
I found a few relevant PRs, so I will list them here.
So, in summary, I don't think there was any change in behavior w/o updating the docs.
For this one, I don't think I should weight in since I'm just a beginner user. So I'll leave it to core maintainers for the final decision.
While grepping around the code base, I actually found |
Another thing I noticed is that current aiohttp's EDIT: |
12d16ec
to
1619d69
Compare
…esponse.last_modified` for invalid http date header
1619d69
to
42f1e97
Compare
With this commit 42f1e97, |
Looks to me like the original code expected the
In general, but these little helper attributes seem like they should not raise exceptions. I don't expect to get a |
@webknjaz Any other concerns or can we merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #6012 +/- ##
=======================================
Coverage 93.33% 93.34%
=======================================
Files 102 102
Lines 30080 30088 +8
Branches 2690 2689 -1
=======================================
+ Hits 28076 28085 +9
Misses 1829 1829
+ Partials 175 174 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Backport to 3.8: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 4744923 on top of patchback/backports/3.8/4744923f8070baa364d5bfd3edd8510a4394303c/pr-6012 Backporting merged PR #6012 into master
🤖 @patchback |
💔 Backport was not successfulThe PR was attempted backported to the following branches:
|
Co-authored-by: Andrew Svetlov <[email protected]>
EDIT: I will update CHANGES and CONTRIBUTORS right away.What do these changes do?
Suppress
ValueError
fromdatetime.datetime
function inBaseRequest._http_date
, which is used for parsing a timestamp in request header (If-Modified-Since
,If-Unmodified-Since
, andIf-Range
).According to the documentation, the corresponding request properties (
if_modified_since
,if_unmodified_since
, andif_range
) are supposed to returnNone
for invalid date, so this PR will make the behavior aligned to the documentation.Are there changes in behavior for the user?
Well... if there are users who want to handle such error by themselves, then they won't be able to see that error anymore, but that seems unlikely.
Related issue number
Fixes #5925
Checklist
CONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.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.