The Fix
pip install urllib3==1.25
Based on closed urllib3/urllib3 issue #303 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -30,6 +30,8 @@ dev (master)
* Add support for IPv6 addresses in subjectAltName section of certificates. (Issue #1269)
+* Switched the default multipart header encoder from RFC 2231 to HTML 5 working draft. (Issue #303, PR #1492)
+
* ... [Short description of non-trivial change.] (Issue #)
Option A — Upgrade to fixed release\npip install urllib3==1.25\nWhen NOT to use: This fix should not be used if the application requires strict adherence to RFC 2231.\n\nOption C — Workaround\nif you're interacting with a single web server, but there is still a need to be able to change encoding formats per-request. @shazow @gagern Is any one working on this (or even wants to)?\nWhen NOT to use: This fix should not be used if the application requires strict adherence to RFC 2231.\n\n
Why This Fix Works in Production
- Trigger: Also, here is an unbroken link to the relevant section in the current HTML5 draft:…
- Mechanism: The library used RFC 2231 for encoding file names, which is not compliant with the current HTML5 standard
- Why the fix works: Changes the default multipart header encoder from RFC 2231 to the HTML5 working draft for encoding non-ASCII file names. (first fixed release: 1.25).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- The library used RFC 2231 for encoding file names, which is not compliant with the current HTML5 standard
- Production symptom (often without a traceback): Also, here is an unbroken link to the relevant section in the current HTML5 draft: [multipart-form-data](http://w3c.github.io/html/sec-forms.html#multipart-form-data)
Proof / Evidence
- GitHub issue: #303
- Fix PR: https://github.com/urllib3/urllib3/pull/1492
- First fixed release: 1.25
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.70
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.70
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Will this ever be fixed? Over 4 years have passed and HTML 5 isn't a draft anymore but an official standard”
“@gagern Yes, please open a PR so we can continue the discussion there and I can leave comments on the diff. :)”
“I'm not aware of anyone working on it, so you're welcome to claim it. :)”
“@sigmavirus24, would like your thoughts on this.”
Failure Signature (Search String)
- Also, here is an unbroken link to the relevant section in the current HTML5 draft: [multipart-form-data](http://w3c.github.io/html/sec-forms.html#multipart-form-data)
- All major browsers now do it this way and most servers cannot handle the `filename*` field with RFC2231 encoding.
Copy-friendly signature
Failure Signature
-----------------
Also, here is an unbroken link to the relevant section in the current HTML5 draft: [multipart-form-data](http://w3c.github.io/html/sec-forms.html#multipart-form-data)
All major browsers now do it this way and most servers cannot handle the `filename*` field with RFC2231 encoding.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Also, here is an unbroken link to the relevant section in the current HTML5 draft: [multipart-form-data](http://w3c.github.io/html/sec-forms.html#multipart-form-data)
All major browsers now do it this way and most servers cannot handle the `filename*` field with RFC2231 encoding.
What Broke
Users experienced issues with non-ASCII file names not being handled correctly by servers.
Why It Broke
The library used RFC 2231 for encoding file names, which is not compliant with the current HTML5 standard
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install urllib3==1.25
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Option C — Workaround Temporary workaround
if you're interacting with a single web server, but there is still a need to be able to change encoding formats per-request. @shazow @gagern Is any one working on this (or even wants to)?
Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.
Fix reference: https://github.com/urllib3/urllib3/pull/1492
First fixed release: 1.25
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the application requires strict adherence to RFC 2231.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 1.25 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.