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

Pytime.c doesn't need to include windows.h #84830

Closed
gongminmin mannequin opened this issue May 16, 2020 · 6 comments
Closed

Pytime.c doesn't need to include windows.h #84830

gongminmin mannequin opened this issue May 16, 2020 · 6 comments
Labels
3.9 only security fixes OS-windows type-feature A feature request or enhancement

Comments

@gongminmin
Copy link
Mannequin

gongminmin mannequin commented May 16, 2020

BPO 40650
Nosy @pfmoore, @tjguk, @zware, @gongminmin, @zooba, @miss-islington
PRs
  • bpo-40650: Include winsock2.h in pytime.c, instead of a full windows.h #20137
  • [3.8] bpo-40650: Include winsock2.h in pytime.c, instead of a full windows.h (GH-20137) #20187
  • [3.7] bpo-40650: Include winsock2.h in pytime.c, instead of a full windows.h (GH-20137) #20188
  • 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 = None
    closed_at = <Date 2020-05-18.16:23:13.212>
    created_at = <Date 2020-05-16.23:30:59.225>
    labels = ['type-feature', '3.9', 'OS-windows']
    title = "Pytime.c doesn't need to include windows.h"
    updated_at = <Date 2020-05-18.16:42:21.689>
    user = 'https://github.com/gongminmin'

    bugs.python.org fields:

    activity = <Date 2020-05-18.16:42:21.689>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-18.16:23:13.212>
    closer = 'steve.dower'
    components = ['Windows']
    creation = <Date 2020-05-16.23:30:59.225>
    creator = 'Minmin.Gong'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40650
    keywords = ['patch']
    message_count = 6.0
    messages = ['369082', '369265', '369266', '369267', '369273', '369274']
    nosy_count = 6.0
    nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'Minmin.Gong', 'steve.dower', 'miss-islington']
    pr_nums = ['20137', '20187', '20188']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue40650'
    versions = ['Python 3.9']

    @gongminmin
    Copy link
    Mannequin Author

    gongminmin mannequin commented May 16, 2020

    Python/pytime.c includes windows.h for timeval. But it's not necessary to include the full header, because timeval is defined in winsock headers.

    @gongminmin gongminmin mannequin added OS-windows 3.9 only security fixes type-feature A feature request or enhancement labels May 16, 2020
    @zooba
    Copy link
    Member

    zooba commented May 18, 2020

    Missing piece of information, it's also _documented_ as being part of the winsock headers: https://docs.microsoft.com/en-us/windows/win32/api/winsock/ns-winsock-timeval

    Plenty of things get included inadvertently, but they can't be relied upon. In this case it seems like an okay change.

    @zooba
    Copy link
    Member

    zooba commented May 18, 2020

    Also, for future reference, compile-only changes typically don't require a NEWS entry (since users are not going to be interested in reading it in the changelog, and we have commit messages for developers). We have the ability to skip the requirement on the PR, so feel free to just ignore the failure until we get to take a look.

    @zooba
    Copy link
    Member

    zooba commented May 18, 2020

    New changeset f660567 by Minmin Gong in branch 'master':
    bpo-40650: Include winsock2.h in pytime.c, instead of a full windows.h (GH-20137)
    f660567

    @zooba zooba closed this as completed May 18, 2020
    @zooba zooba closed this as completed May 18, 2020
    @miss-islington
    Copy link
    Contributor

    New changeset 8e49c1f by Miss Islington (bot) in branch '3.7':
    bpo-40650: Include winsock2.h in pytime.c, instead of a full windows.h (GH-20137)
    8e49c1f

    @miss-islington
    Copy link
    Contributor

    New changeset ab9d953 by Miss Islington (bot) in branch '3.8':
    bpo-40650: Include winsock2.h in pytime.c, instead of a full windows.h (GH-20137)
    ab9d953

    @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
    3.9 only security fixes OS-windows type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants