Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

http.client.HTTPResponse.read1 does not close response after reading all data #113199

Closed
Labels
stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@illia-v

Description

@illia-v

Bug report

Bug description:

While trying to useread1 in urllib3, we discovered thatread1 unlikeread never closes the response after reading all data when the content length is known (urllib3/urllib3#3235).


importhttp.clientconn=http.client.HTTPSConnection("www.python.org")conn.request("GET","/")response=conn.getresponse()

This runs successfully:

response.read()assertresponse.isclosed()

This fails:

whileresponse.read1():passassertresponse.isclosed()

CPython versions tested on:

3.8, 3.9, 3.10, 3.11, 3.12, 3.13, CPython main branch

Operating systems tested on:

Linux, macOS, Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard 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


      [8]ページ先頭

      ©2009-2025 Movatter.jp