Request for merge: Fix http.cookies module to support obsolete RFC 850 date format

Would anyone be able to help review and potentially merge this PR?

According to RFC 9110, a recipient that parses a timestamp value in an HTTP field MUST accept all three HTTP-date formats. This includes the obsolete RFC 850 date format, such as “Sunday, 06-Nov-94 08:49:37 GMT.” However, the http.cookies module in Python’s standard library currently fails to parse this format. As a result, cookies using this date format are discarded entirely.

I’ve worked on a fix for this issue and added the appropriate tests for it. The PR has already been reviewed by multiple contributors and is now in the ‘awaiting merge’ state.

If anyone could take a look at the PR and share their thoughts, I’d really appreciate it! Also, I was wondering—if I’m hoping for it to be merged, is there someone specific I should reach out to?

Thanks a lot for your help!

I approved your PR but I couldn’t merge it since some mandatory CI jobs didn’t run, and then I forgot about the PR. I just clicked on [Update branch] and enabled auto merge. Let’s see if it’s enough to merge the PR.

3 Likes

Glad to see the PR has been merged. Thanks, @vstinner.
This PR still needs to be backported to other versions.