Skip to content

ResourceWarning due to unclosed response in http.client.HTTPConnection._tunnel #103472

Description

@graingert

Bug report

calling http.client.HTTPConnection._tunnel() may result in a ResourceWarning because the response is not closed

this results in an intermittent failure on the urllib3 test test/with_dummyserver/test_proxy_poolmanager.py::TestHTTPProxyManager::test_tunneling_proxy_request_timeout[https-https] with ResourceWarnings enabled, see https://github.com/urllib3/urllib3/actions/runs/4638944124/jobs/8209257011#step:6:2471 and https://github.com/urllib3/urllib3/blob/4d425a2d767ce2e0c988fff4385046ea57458c49/test/with_dummyserver/test_proxy_poolmanager.py#L480-L498

Your environment

  • CPython versions tested on: 3.8-3.11

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    stdlibStandard Library Python modules in the Lib/ directory
    3.11only security fixes
    3.12only security fixes
    3.13only security fixes
    on Apr 12, 2023
  2. added a commit that references this issue on Apr 12, 2023
  3. changed the title [-]ResourceWarning due to unclosed request in http.client.HTTPConnection._tunnel[/-] [+]ResourceWarning due to unclosed response in http.client.HTTPConnection._tunnel[/+] on Apr 12, 2023
  4. added a commit that references this issue on May 2, 2023
  5. added a commit that references this issue on May 2, 2023
  6. added a commit that references this issue on May 2, 2023
  7. hauntsaninja commented on Sep 7, 2023

    @hauntsaninja
    Contributor

    Looks like this was fixed, thanks all!

  8. added a commit that references this issue on Sep 12, 2024
  9. added a commit that references this issue on May 11, 2026
  10. added a commit that references this issue on May 14, 2026
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.11only security fixes3.12only security fixes3.13only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions