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

Dead assignment in idna_converter function #87527

Closed
alexhenrie mannequin opened this issue Mar 2, 2021 · 3 comments
Closed

Dead assignment in idna_converter function #87527

alexhenrie mannequin opened this issue Mar 2, 2021 · 3 comments
Labels
3.10 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@alexhenrie
Copy link
Mannequin

alexhenrie mannequin commented Mar 2, 2021

BPO 43361
Nosy @alexhenrie, @iritkatriel
PRs
  • bpo-43361: Remove dead assignment from idna_converter function #24701
  • 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 = None
    created_at = <Date 2021-03-02.02:29:09.605>
    labels = ['type-feature', 'library', '3.10']
    title = 'Dead assignment in idna_converter function'
    updated_at = <Date 2022-01-29.23:51:42.236>
    user = 'https://github.com/alexhenrie'

    bugs.python.org fields:

    activity = <Date 2022-01-29.23:51:42.236>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2021-03-02.02:29:09.605>
    creator = 'alex.henrie'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43361
    keywords = ['patch']
    message_count = 2.0
    messages = ['387896', '412109']
    nosy_count = 2.0
    nosy_names = ['alex.henrie', 'iritkatriel']
    pr_nums = ['24701']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue43361'
    versions = ['Python 3.10']

    @alexhenrie
    Copy link
    Mannequin Author

    alexhenrie mannequin commented Mar 2, 2021

    The idna_converter function in socketmodule.c currently initializes the variable len to -1, then reinitializes it on every path that uses it. The first initialization could be removed to simplify the code and clarify its intent.

    Defect identified by scan-build <https://clang-analyzer.llvm.org/scan-build.html\>

    @alexhenrie alexhenrie mannequin added 3.10 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Mar 2, 2021
    @iritkatriel
    Copy link
    Member

    I don't think removing this will make the code easier to read. It's an exercise to verify that all the different if-else branches set this variable.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @kumaraditya303
    Copy link
    Contributor

    Yeah, the existing code is better.

    @kumaraditya303 kumaraditya303 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2023
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants