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

zipfile: Add descriptive global variables for general purpose bit flags #88295

Closed
danifus mannequin opened this issue May 14, 2021 · 3 comments
Closed

zipfile: Add descriptive global variables for general purpose bit flags #88295

danifus mannequin opened this issue May 14, 2021 · 3 comments
Labels
3.11 only security fixes stdlib Python modules in the Lib dir

Comments

@danifus
Copy link
Mannequin

danifus mannequin commented May 14, 2021

BPO 44129
Nosy @serhiy-storchaka, @vxgmichel, @danifus
PRs
  • bpo-44129: Add descriptive global variables for general purpose bit f… #26118
  • 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 2021-07-03.14:39:18.476>
    created_at = <Date 2021-05-14.04:53:27.395>
    labels = ['library', '3.11']
    title = 'zipfile: Add descriptive global variables for general purpose bit flags'
    updated_at = <Date 2021-09-09.08:44:42.613>
    user = 'https://github.com/danifus'

    bugs.python.org fields:

    activity = <Date 2021-09-09.08:44:42.613>
    actor = 'vxgmichel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-07-03.14:39:18.476>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2021-05-14.04:53:27.395>
    creator = 'dhillier'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44129
    keywords = ['patch']
    message_count = 3.0
    messages = ['393622', '396906', '396907']
    nosy_count = 3.0
    nosy_names = ['serhiy.storchaka', 'vxgmichel', 'dhillier']
    pr_nums = ['26118']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue44129'
    versions = ['Python 3.11']

    @danifus
    Copy link
    Mannequin Author

    danifus mannequin commented May 14, 2021

    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

    @danifus danifus mannequin added 3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir labels May 14, 2021
    @serhiy-storchaka
    Copy link
    Member

    New changeset 556d5ad by Daniel Hillier in branch 'main':
    bpo-44129: Add descriptive global variables for general purpose bit flags (GH-26118)
    556d5ad

    @serhiy-storchaka
    Copy link
    Member

    Thank you for your contribution Daniel.

    @serhiy-storchaka serhiy-storchaka removed the 3.10 only security fixes label Jul 3, 2021
    @serhiy-storchaka serhiy-storchaka removed the 3.10 only security fixes label Jul 3, 2021
    @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.11 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant