This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: zipfile: Add descriptive global variables for general purpose bit flags
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: dhillier, serhiy.storchaka, vxgmichel
Priority: normal Keywords: patch

Created on 2021-05-14 04:53 by dhillier, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 26118 merged dhillier, 2021-05-14 05:36
Messages (3)
msg393622 - (view) Author: Daniel Hillier (dhillier) * Date: 2021-05-14 04:53
In the zipfile module, masking of bit flags is done against hex numbers eg. if flags & 0x800...

To increase readability I suggest we replace these with global variables named for the purpose of the flag. From the example above:

if flags & 0x800
becomes:
if flags & _MASK_UTF_FILENAME
msg396906 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-03 14:38
New changeset 556d5ad11fb380868c19beeba53d49f89c27f32d by Daniel Hillier in branch 'main':
bpo-44129: Add descriptive global variables for general purpose bit flags (GH-26118)
https://github.com/python/cpython/commit/556d5ad11fb380868c19beeba53d49f89c27f32d
msg396907 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-03 14:39
Thank you for your contribution Daniel.
History
Date User Action Args
2022-04-11 14:59:45adminsetgithub: 88295
2021-09-09 08:44:42vxgmichelsetpull_requests: - pull_request26670
2021-09-09 08:40:38vxgmichelsetnosy: + vxgmichel

pull_requests: + pull_request26670
2021-07-03 14:39:18serhiy.storchakasetstatus: open -> closed
versions: - Python 3.10
messages: + msg396907

resolution: fixed
stage: patch review -> resolved
2021-07-03 14:38:10serhiy.storchakasetmessages: + msg396906
2021-05-14 05:36:52dhilliersetkeywords: + patch
stage: patch review
pull_requests: + pull_request24763
2021-05-14 04:53:27dhilliercreate