GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function · Issue #89735 · python/cpython

urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function #89735

New issue
Copy link
New issue
Copy link
Closed
Closed
urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function#89735
Copy link
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

sxt1001
mannequin
opened on Oct 22, 2021
Issue body actions
BPO 45572
Nosy @Fidget-Spinner, @akulakov
PRs
  • gh-89735: documented *headers* param for urllib.request.http_error_auth_reqed() #30814
  • Files
  • 3.7.4 hang on.png
  • 3.7.4 fix Regex ok.png
  • 3.7.12 fail.png
  • 3.11.0a1 fail.png
  • 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-10-22.13:35:34.228>
    labels = ['type-bug', '3.8', '3.9', '3.10', '3.11', '3.7', 'library']
    title = "urllib.request:AttributeError: 'dict' object has no attribute 'get_all' in http_error_auth_reqed function"
    updated_at = <Date 2022-01-23.00:57:40.389>
    user = 'https://bugs.python.org/sxt1001'

    bugs.python.org fields:

    activity = <Date 2022-01-23.00:57:40.389>
    actor = 'vstinner'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2021-10-22.13:35:34.228>
    creator = 'sxt1001'
    dependencies = []
    files = ['50386', '50387', '50388', '50389']
    hgrepos = []
    issue_num = 45572
    keywords = ['patch']
    message_count = 3.0
    messages = ['404767', '406813', '411318']
    nosy_count = 3.0
    nosy_names = ['kj', 'andrei.avk', 'sxt1001']
    pr_nums = ['30814']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue45572'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10', 'Python 3.11']

    Linked PRs

    • gh-89735: Document requirements for the *headers* argument #155640
    • [3.15] gh-89735: Document requirements for the *headers* argument (GH-155640) #156898
    • [3.14] gh-89735: Document requirements for the *headers* argument (GH-155640) #156899
    • [3.13] gh-89735: Document requirements for the *headers* argument (GH-155640) #156900

    Activity

    Next
    1. sxt1001 commented on Oct 22, 2021

      @sxt1001
      sxt1001mannequin
      on Oct 22, 2021
      MannequinAuthor
      More actions

      The python version I currently use in my development environment is 3.7.4. Using the following script, the program has never output, and seems to have entered an infinite loop.

      To reproduce the issue we can use the following code:

      from urllib.request import AbstractBasicAuthHandler
      auth_handler = AbstractBasicAuthHandler()
      header = {'www-authenticate': 'Basic ' + ',' * 64 + ' ' + 'foo' + ' ' +'realm'}
      auth_handler.http_error_auth_reqed('www-authenticate','unused','unused',header)

      So I tried to upgrade it to version 3.7.12, and the program will directly report an error. The information is as follows:

      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File "/usr/local/lib/python3.7/urllib/request.py", line 990, in http_error_auth_reqed
          headers = headers.get_all(authreq)
      AttributeError: 'dict' object has no attribute 'get_all'

      This problem also exists when I upgrade Python 3 to 3.11.0a1. In Python version 3.7.4, the cause of program hang on seems to be a security vulnerability. Refer to https://bugs.python.org/issue39503. The reason for CVE is not the wrong type of headers. However, after repairing CVE, it seems that the type of headers is limited? For the CVE patch, I tried to only fix the part of the regular expression, and the program can run. So, after repairing CVE-2020-8492, what type should the headers parameter be for http_error_auth_reqed function? Based on the current code, how should I adapt and modify it to make it run normally?

    2. sxt1001
      added
      3.7 (EOL)end of lifeend of life
      3.8 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      3.10 (EOL)end of lifeend of life
      3.11only security fixesonly security fixes
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
      on Oct 22, 2021
    3. 9 remaining items

    4. serhiy-storchaka
      added
      docsDocumentation in the Doc dirDocumentation in the Doc dir
      3.13only security fixesonly security fixes
      3.14bugs and security fixesbugs and security fixes
      3.15bugs and security fixesbugs and security fixes
      3.16new features, bugs and security fixesnew features, bugs and security fixes
      and removed
      3.9 (EOL)end of lifeend of life
      on Aug 12, 2026
    5. github-project-automation
      added this to docs issueson Aug 12, 2026
    6. github-project-automation
      moved this to Todo in docs issueson Aug 12, 2026
    7. serhiy-storchaka
      added a commit that references this issue on Sep 3, 2026

      gh-89735: Document requirements for the *headers* argument (GH-155640)

      1414d2a
    8. serhiy-storchaka
      closed this as completedon Sep 3, 2026
    9. github-project-automation
      moved this from Todo to Done in Urllib issueson Sep 3, 2026
    10. serhiy-storchaka
      added 2 commits that reference this issue on Sep 3, 2026

      [3.13] gh-89735: Document requirements for the *headers* argument (GH…

      50bef2d

      [3.14] gh-89735: Document requirements for the *headers* argument (GH…

      a8a1871
    11. hugovk
      added a commit that references this issue on Sep 5, 2026

      [3.15] gh-89735: Document requirements for the *headers* argument (GH…

      ab2aa4f
    12. clin1234
      added a commit that references this issue on Sep 12, 2026

      pythongh-89735: Document requirements for the *headers* argument (pyt…

      8fe48c0
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixes3.15bugs and security fixesbugs and security fixes3.16new features, bugs and security fixesnew features, bugs and security fixesdocsDocumentation in the Doc dirDocumentation in the Doc dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

      Projects

      • docs issues
        Status
        Todo
        Show more project fields
      • Urllib issues
        Status
        Done
        Show more project fields

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.