classification
Title: Missing constants in Lib/stat.py
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Ronan.Lamy, brandtbucher, pitrou, vstinner
Priority: normal Keywords: patch

Created on 2019-09-11 13:35 by Ronan.Lamy, last changed 2019-10-10 14:08 by Ronan.Lamy. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16665 merged Ronan.Lamy, 2019-10-08 19:01
PR 16690 merged miss-islington, 2019-10-10 07:35
PR 16691 merged miss-islington, 2019-10-10 07:35
Messages (8)
msg351870 - (view) Author: Ronan Lamy (Ronan.Lamy) * Date: 2019-09-11 13:35
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.
msg354320 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-10-10 07:34
New changeset 7bb14316b8ceddb813f31040a299af94a57ab339 by Victor Stinner (Ronan Lamy) in branch 'master':
bpo-38109: Add missing constants to Lib/stat.py (GH-16665)
https://github.com/python/cpython/commit/7bb14316b8ceddb813f31040a299af94a57ab339
msg354321 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-10-10 07:37
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.
msg354372 - (view) Author: Ronan Lamy (Ronan.Lamy) * Date: 2019-10-10 13:47
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.
msg354374 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-10-10 13:50
New changeset 8ab11c433a81b6c7ef84a66e36fbe199915e2ff6 by Victor Stinner (Miss Islington (bot)) in branch '3.8':
bpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16690)
https://github.com/python/cpython/commit/8ab11c433a81b6c7ef84a66e36fbe199915e2ff6
msg354375 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-10-10 13:50
New changeset f5ed41c1ae9a575e965d55c6a5e86fb59181eee8 by Victor Stinner (Miss Islington (bot)) in branch '3.7':
bpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16691)
https://github.com/python/cpython/commit/f5ed41c1ae9a575e965d55c6a5e86fb59181eee8
msg354376 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-10-10 13:52
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 ;-)
msg354380 - (view) Author: Ronan Lamy (Ronan.Lamy) * Date: 2019-10-10 14:08
Thanks Victor!
History
Date User Action Args
2019-10-10 14:08:22Ronan.Lamysetmessages: + msg354380
2019-10-10 13:52:05vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg354376

stage: patch review -> resolved
2019-10-10 13:50:41vstinnersetmessages: + msg354375
2019-10-10 13:50:37vstinnersetmessages: + msg354374
2019-10-10 13:47:27Ronan.Lamysetmessages: + msg354372
2019-10-10 07:37:02vstinnersetmessages: + msg354321
2019-10-10 07:35:08miss-islingtonsetpull_requests: + pull_request16278
2019-10-10 07:35:02miss-islingtonsetpull_requests: + pull_request16277
2019-10-10 07:34:49vstinnersetmessages: + msg354320
2019-10-08 20:03:24brandtbuchersetnosy: + brandtbucher
2019-10-08 19:01:21Ronan.Lamysetkeywords: + patch
stage: patch review
pull_requests: + pull_request16248
2019-09-11 18:16:28nanjekyejoannahsetnosy: + pitrou, vstinner
2019-09-11 13:35:59Ronan.Lamycreate