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

Missing constants in Lib/stat.py #82290

Closed
rlamy mannequin opened this issue Sep 11, 2019 · 8 comments
Closed

Missing constants in Lib/stat.py #82290

rlamy mannequin opened this issue Sep 11, 2019 · 8 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir

Comments

@rlamy
Copy link
Mannequin

rlamy mannequin commented Sep 11, 2019

BPO 38109
Nosy @pitrou, @vstinner, @rlamy, @brandtbucher
PRs
  • bpo-38109: Add missing constants to Lib/stat.py #16665
  • [3.8] bpo-38109: Add missing constants to Lib/stat.py (GH-16665) #16690
  • [3.7] bpo-38109: Add missing constants to Lib/stat.py (GH-16665) #16691
  • 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 2019-10-10.13:52:05.729>
    created_at = <Date 2019-09-11.13:35:59.349>
    labels = ['3.8', '3.7', 'library', '3.9']
    title = 'Missing constants in Lib/stat.py'
    updated_at = <Date 2019-10-10.14:08:22.705>
    user = 'https://github.com/rlamy'

    bugs.python.org fields:

    activity = <Date 2019-10-10.14:08:22.705>
    actor = 'Ronan.Lamy'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-10-10.13:52:05.729>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2019-09-11.13:35:59.349>
    creator = 'Ronan.Lamy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38109
    keywords = ['patch']
    message_count = 8.0
    messages = ['351870', '354320', '354321', '354372', '354374', '354375', '354376', '354380']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'vstinner', 'Ronan.Lamy', 'brandtbucher']
    pr_nums = ['16665', '16690', '16691']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue38109'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @rlamy
    Copy link
    Mannequin Author

    rlamy mannequin commented Sep 11, 2019

    According to the docs, stat should include constants S_IFDOOR, S_IFPORT, S_IFWHT as well as the related S_IS... functions. However, these are only defined in _stat. I know that stat is a bit special (see bpo-11016), but that goes against PEP-399.

    @rlamy rlamy mannequin added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir labels Sep 11, 2019
    @vstinner
    Copy link
    Member

    New changeset 7bb1431 by Victor Stinner (Ronan Lamy) in branch 'master':
    bpo-38109: Add missing constants to Lib/stat.py (GH-16665)
    7bb1431

    @vstinner
    Copy link
    Member

    Ronan Lamy: Hum, do you really need this change to land in Python 3.7 and 3.8? If not, I will close PR 16690 and PR 16691 backports.

    I don't think that it's worth it, since _stat should be always present in CPython.

    @rlamy
    Copy link
    Mannequin Author

    rlamy mannequin commented Oct 10, 2019

    Well, my interest in this is to reduce the divergence between PyPy and CPython, and, potentially, to help other implementations. So I actually care more about 3.7 than about 3.9, which I probably won't look at before 2021.

    That said, I don't *need* anything: the fix is already in PyPy and we'll carry it forward regardless of what CPython does.

    @vstinner
    Copy link
    Member

    New changeset 8ab11c4 by Victor Stinner (Miss Islington (bot)) in branch '3.8':
    bpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16690)
    8ab11c4

    @vstinner
    Copy link
    Member

    New changeset f5ed41c by Victor Stinner (Miss Islington (bot)) in branch '3.7':
    bpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16691)
    f5ed41c

    @vstinner
    Copy link
    Member

    I understand that backporting the change up to 3.7 makes your life easier, so I merged it. The change is safe and should not affect the regular use case (when the C extension _stat is used).

    Thanks Ronan for this nice enhancement. It's good to see the stat module respect the PEP-399 ;-)

    @rlamy
    Copy link
    Mannequin Author

    rlamy mannequin commented Oct 10, 2019

    Thanks Victor!

    @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.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant