This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [Copy from github user macartur] time2netscape missing comma
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: Robby Daigle, efm, orsenthil, python-dev
Priority: normal Keywords: patch

Created on 2016-07-08 03:24 by Robby Daigle, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue27466.patch orsenthil, 2016-07-08 05:16
issue27466-v2.patch orsenthil, 2016-07-09 08:01 review
Repositories containing patches
https://hg.python.org/cpython/
Messages (9)
msg269968 - (view) Author: Robby Daigle (Robby Daigle) Date: 2016-07-08 03:24
For the time2netscape function.
expected: Wed, DD-Mon-YYYY HH:MM:SS GMT
got: Wed DD-Mon-YYYY HH:MM:SS GMT

In Lib/http/cookiejar.py, line 116 suggests that the format should include a comma while line 123 does not include the comma in the formatted string.

Wondering if 116 or 123 is wrong.
msg269969 - (view) Author: Evelyn Mitchell (efm) Date: 2016-07-08 04:05
http://web.archive.org/web/19990128171928/http://www51.netscape.com/newsref/std/cookie_spec.html says:
The date string is formatted as:

Wdy, DD-Mon-YYYY HH:MM:SS GMT

so the comma should be there.
msg269971 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2016-07-08 04:25
Evelyn,

Thanks for digging in.

The code for time2netscape has been in the current form since it was originally introduced in 2004. If this is a bug, then it has been present since the introduction of the module.  If anyone is using this module, they are probably relying the existing behavior.

The spec you pointed out says that this is a bug. The bug fix can go in 2.7, 3.5 and 3.6 releases.
msg269974 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2016-07-08 05:16
Here is the patch that fixes this issue. Patch includes unittests and NEWS entry.
msg269989 - (view) Author: Robby Daigle (Robby Daigle) Date: 2016-07-08 14:54
Thanks!
msg270027 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2016-07-09 08:01
Fixed the redundant import as pointed by Evelyn on IRC.
msg270086 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-07-10 13:49
New changeset 3356d7c57750 by Senthil Kumaran in branch '3.5':
Issue #27466: Change time format returned by http.cookie.time2netscape,
https://hg.python.org/cpython/rev/3356d7c57750

New changeset 324ade62c0f0 by Senthil Kumaran in branch 'default':
[merge from 3.5] - Issue #27466: Change time format returned by
https://hg.python.org/cpython/rev/324ade62c0f0
msg270090 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-07-10 15:34
New changeset c613d8885054 by Senthil Kumaran in branch '2.7':
[port to 2.7] - Issue #27466: Change time format returned by
https://hg.python.org/cpython/rev/c613d8885054
msg270091 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2016-07-10 15:35
This is fixed in all versions of python. Thanks for the review.
History
Date User Action Args
2022-04-11 14:58:33adminsetgithub: 71653
2016-07-31 16:04:34orsenthilsetstage: patch review -> resolved
2016-07-10 15:35:25orsenthilsetstatus: open -> closed
type: behavior
resolution: fixed
messages: + msg270091
2016-07-10 15:34:29python-devsetmessages: + msg270090
2016-07-10 13:49:59python-devsetnosy: + python-dev
messages: + msg270086
2016-07-09 08:01:35orsenthilsetfiles: + issue27466-v2.patch

messages: + msg270027
2016-07-08 14:54:59Robby Daiglesetmessages: + msg269989
2016-07-08 05:16:09orsenthilsetfiles: + issue27466.patch
messages: + msg269974

assignee: orsenthil
keywords: + patch
stage: patch review
2016-07-08 04:25:25orsenthilsetnosy: + orsenthil

messages: + msg269971
versions: - Python 3.2, Python 3.3, Python 3.4
2016-07-08 04:05:12efmsetnosy: + efm
messages: + msg269969
2016-07-08 03:24:20Robby Daiglecreate