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

Do not call localtime (gmtime) in datetime module #72254

Closed
abalkin opened this issue Sep 10, 2016 · 6 comments
Closed

Do not call localtime (gmtime) in datetime module #72254

abalkin opened this issue Sep 10, 2016 · 6 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@abalkin
Copy link
Member

abalkin commented Sep 10, 2016

BPO 28067
Nosy @mdickinson, @abalkin
Files
  • issue28067.diff
  • 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/abalkin'
    closed_at = <Date 2016-09-10.19:58:35.576>
    created_at = <Date 2016-09-10.19:13:49.254>
    labels = ['type-bug']
    title = 'Do not call localtime (gmtime) in datetime module'
    updated_at = <Date 2016-09-10.20:51:22.070>
    user = 'https://github.com/abalkin'

    bugs.python.org fields:

    activity = <Date 2016-09-10.20:51:22.070>
    actor = 'python-dev'
    assignee = 'belopolsky'
    closed = True
    closed_date = <Date 2016-09-10.19:58:35.576>
    closer = 'python-dev'
    components = []
    creation = <Date 2016-09-10.19:13:49.254>
    creator = 'belopolsky'
    dependencies = []
    files = ['44537']
    hgrepos = []
    issue_num = 28067
    keywords = ['patch']
    message_count = 6.0
    messages = ['275678', '275689', '275690', '275691', '275692', '275695']
    nosy_count = 3.0
    nosy_names = ['mark.dickinson', 'belopolsky', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28067'
    versions = ['Python 3.6']

    @abalkin
    Copy link
    Member Author

    abalkin commented Sep 10, 2016

    POSIX localtime function mutates global state which leads to subtle bugs on some platforms. We should call localtime_r or localtime_s instead.

    See bpo-22627.

    @abalkin abalkin self-assigned this Sep 10, 2016
    @abalkin abalkin added the type-bug An unexpected behavior, bug, or error label Sep 10, 2016
    @abalkin abalkin changed the title Do not call localtime in datetime module Do not call localtime (gmtime) in datetime module Sep 10, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 10, 2016

    New changeset 8a504694d92f by Alexander Belopolsky in branch 'default':
    Closes bpo-28067: Do not call localtime (gmtime) in datetime module.
    https://hg.python.org/cpython/rev/8a504694d92f

    @python-dev python-dev mannequin closed this as completed Sep 10, 2016
    @mdickinson
    Copy link
    Member

    What is gmime_s?

    @abalkin
    Copy link
    Member Author

    abalkin commented Sep 10, 2016

    What is gmime_s?

    A typo. Should be gmtime_s.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 10, 2016

    New changeset 5bdfe132e4ed by Alexander Belopolsky in branch 'default':
    bpo-28067: Fixed a typo.
    https://hg.python.org/cpython/rev/5bdfe132e4ed

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 10, 2016

    New changeset c7e477fa9e09 by Alexander Belopolsky in branch 'default':
    bpo-28067: Fixed another typo.
    https://hg.python.org/cpython/rev/c7e477fa9e09

    @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
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants