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

http/client.py does not print duplicate header values in debug #80703

Closed
houglum mannequin opened this issue Apr 4, 2019 · 4 comments
Closed

http/client.py does not print duplicate header values in debug #80703

houglum mannequin opened this issue Apr 4, 2019 · 4 comments
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir

Comments

@houglum
Copy link
Mannequin

houglum mannequin commented Apr 4, 2019

BPO 36522
Nosy @serhiy-storchaka, @houglum
PRs
  • bpo-36522: Print all values for headers with multiple values #12681
  • [3.7] bpo-36522: Print all values for headers with multiple values. (GH-12681) #12682
  • 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-04-04.08:27:34.368>
    created_at = <Date 2019-04-04.02:45:33.702>
    labels = ['3.8', '3.7', 'library']
    title = 'http/client.py does not print duplicate header values in debug'
    updated_at = <Date 2019-04-04.08:27:34.367>
    user = 'https://github.com/houglum'

    bugs.python.org fields:

    activity = <Date 2019-04-04.08:27:34.367>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-04-04.08:27:34.368>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2019-04-04.02:45:33.702>
    creator = 'houglum'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36522
    keywords = ['patch']
    message_count = 4.0
    messages = ['339424', '339432', '339435', '339436']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'houglum']
    pr_nums = ['12681', '12682']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36522'
    versions = ['Python 3.7', 'Python 3.8']

    @houglum
    Copy link
    Mannequin Author

    houglum mannequin commented Apr 4, 2019

    This is a follow-up to https://bugs.python.org/issue33365. The fix for that issue (see #6611) added a statement to also print header values, but it does not account for the case where multiple values exist for the same header name, e.g. if my response contained these headers:

    x-goog-hash: crc32c=KAwGng==
    x-goog-hash: md5=eB5eJF1ptWaXm4bijSPyxw==

    then the debug output would print whichever of those values is returned from self.headers.get("x-goog-hash") for both prints:

    header: x-goog-hash: crc32c=KAwGng==
    header: x-goog-hash: crc32c=KAwGng==

    The iteration should instead be done using self.headers.items(), which will return the key and value pair to be printed. I'll send a GitHub PR shortly.

    @houglum houglum mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir labels Apr 4, 2019
    @serhiy-storchaka
    Copy link
    Member

    New changeset 461c416 by Serhiy Storchaka (Matt Houglum) in branch 'master':
    bpo-36522: Print all values for headers with multiple values. (GH-12681)
    461c416

    @serhiy-storchaka
    Copy link
    Member

    New changeset 6f9cd14 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.7':
    bpo-36522: Print all values for headers with multiple values. (GH-12681) (GH-12682)
    6f9cd14

    @serhiy-storchaka
    Copy link
    Member

    3.6 take only security bugs fixes now.

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

    No branches or pull requests

    1 participant