Skip to content

Clarify multipart transport read sizes - #411

Draft
lexingtonhibiki wants to merge 1 commit into
requests:mainfrom
lexingtonhibiki:docs/multipart-read-size-20261024
Draft

lexingtonhibiki wants to merge 1 commit into
requests:mainfrom
lexingtonhibiki:docs/multipart-read-size-20261024

Conversation

@lexingtonhibiki

Copy link
Copy Markdown

Summary

Closes #368. This is the documentation-only update invited in #368 (comment).

Replace the outdated MultipartEncoder warning that httplib always reads 8192 bytes and the old request for feedback on an encoder option. The new note explains that the HTTP transport's version and configuration determine the requested read size, links the Python and urllib3 connection APIs, and makes clear that the encoder does not configure those connections. It does not substitute another fixed default or add a new setting.

The only other change is the AUTHORS.rst entry required by the contribution guide.

Validation

  • Six offline send-path checks using actual http.client.HTTPConnection and urllib3.connection.HTTPConnection, a real encoder, and a fake socket sink: each default plus explicit 4096/32768 read sizes. Every requested size matched the connection setting, and every reconstructed multipart body matched the complete encoder output. No HTTP request was sent to a server.
  • Executable Python AST is unchanged after excluding the class docstring; signatures and runtime behavior are unchanged.
  • Standard Sphinx 9.1.1 HTML builds of the base and candidate both succeed with the same existing get_html_theme_path deprecation warning. Checked the rendered upload page and both new links. These builds are not warning-free or offline.
  • git diff --check passes.

Prepared with AI assistance and independently reviewed by an AI agent. The focused checks ran on Python 3.12.14 / urllib3 2.8.0; they are not a full test suite, Requests Session integration test, multi-version test matrix, or performance benchmark.

Document transport-owned read sizes instead of a fixed httplib\nlimit and an outdated encoder option proposal. Link the current\nconnection APIs without adding runtime behavior.\n\nCloses requests#368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MultipartEncoder Block Size

1 participant