Skip to content
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

[Copy from github user macartur] time2netscape missing comma #71653

Closed
RobbyDaigle mannequin opened this issue Jul 8, 2016 · 9 comments
Closed

[Copy from github user macartur] time2netscape missing comma #71653

RobbyDaigle mannequin opened this issue Jul 8, 2016 · 9 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@RobbyDaigle
Copy link
Mannequin

RobbyDaigle mannequin commented Jul 8, 2016

BPO 27466
Nosy @orsenthil
Files
  • issue27466.patch
  • issue27466-v2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/orsenthil'
    closed_at = <Date 2016-07-10.15:35:25.873>
    created_at = <Date 2016-07-08.03:24:20.162>
    labels = ['type-bug', 'library']
    title = '[Copy from github user macartur] time2netscape missing comma'
    updated_at = <Date 2016-07-31.16:04:34.839>
    user = 'https://bugs.python.org/RobbyDaigle'

    bugs.python.org fields:

    activity = <Date 2016-07-31.16:04:34.839>
    actor = 'orsenthil'
    assignee = 'orsenthil'
    closed = True
    closed_date = <Date 2016-07-10.15:35:25.873>
    closer = 'orsenthil'
    components = ['Library (Lib)']
    creation = <Date 2016-07-08.03:24:20.162>
    creator = 'Robby Daigle'
    dependencies = []
    files = ['43659', '43666']
    hgrepos = ['347']
    issue_num = 27466
    keywords = ['patch']
    message_count = 9.0
    messages = ['269968', '269969', '269971', '269974', '269989', '270027', '270086', '270090', '270091']
    nosy_count = 4.0
    nosy_names = ['efm', 'orsenthil', 'python-dev', 'Robby Daigle']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue27466'
    versions = ['Python 2.7', 'Python 3.5', 'Python 3.6']

    @RobbyDaigle
    Copy link
    Mannequin Author

    RobbyDaigle mannequin commented Jul 8, 2016

    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.

    @RobbyDaigle RobbyDaigle mannequin added the stdlib Python modules in the Lib dir label Jul 8, 2016
    @efm
    Copy link
    Mannequin

    efm mannequin commented Jul 8, 2016

    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.

    @orsenthil
    Copy link
    Member

    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.

    @orsenthil
    Copy link
    Member

    Here is the patch that fixes this issue. Patch includes unittests and NEWS entry.

    @orsenthil orsenthil self-assigned this Jul 8, 2016
    @RobbyDaigle
    Copy link
    Mannequin Author

    RobbyDaigle mannequin commented Jul 8, 2016

    Thanks!

    @orsenthil
    Copy link
    Member

    Fixed the redundant import as pointed by Evelyn on IRC.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 10, 2016

    New changeset 3356d7c57750 by Senthil Kumaran in branch '3.5':
    Issue bpo-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 bpo-27466: Change time format returned by
    https://hg.python.org/cpython/rev/324ade62c0f0

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 10, 2016

    New changeset c613d8885054 by Senthil Kumaran in branch '2.7':
    [port to 2.7] - Issue bpo-27466: Change time format returned by
    https://hg.python.org/cpython/rev/c613d8885054

    @orsenthil
    Copy link
    Member

    This is fixed in all versions of python. Thanks for the review.

    @orsenthil orsenthil added the type-bug An unexpected behavior, bug, or error label Jul 10, 2016
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant