python-multipart 0.0.20 to 0.0.34: what breaks when you upgrade
Updated November 28, 2026
On this page
What breaks when you upgrade python-multipart from 0.0.20 to 0.0.34?
For most FastAPI and Starlette apps, nothing in your code breaks. What changes is how some requests parse. The one you're most likely to hit: a form body like user=ann;role=admin now arrives as one field instead of two. If you call python-multipart directly, also check for trust_x_headers, custom FormParser classes and anything that relied on parsers sharing callbacks.
There are 14 releases between the two (0.0.21 to 0.0.34, per the python-multipart changelog), and most entries are speedups. These are the ones that change what your app sees:
| Version (date) | Change | Who notices |
|---|---|---|
| 0.0.21 (Dec 17, 2025) | Drops Python 3.8 and 3.9. | Anyone still on 3.9: pip stops at 0.0.20. |
| 0.0.22 (Jan 25, 2026) | Drops the directory path from an upload's filename when it's written to disk. | Apps that set UPLOAD_KEEP_FILENAME. |
| 0.0.23 (Apr 5, 2026) | Removes trust_x_headers and the X-File-Name fallback. | Code that calls create_form_parser with it. |
| 0.0.25 (Apr 10, 2026) | Removes custom FormParser classes; headers and Content-Transfer-Encoding match case-insensitively. | Code that swapped in its own File or Field class. |
| 0.0.26 and 0.0.27 (Apr 2026) | Discards data after the closing boundary; adds limits on multipart part headers. | Clients that send oversized or trailing data. |
| 0.0.28 (May 10, 2026) | Caps the multipart boundary at 256 bytes. | Clients with very long boundaries. |
| 0.0.30 (May 31, 2026) | Only & separates URL-encoded fields; filename* and name* are ignored. | Clients that send ; between fields. |
| 0.0.33 (Oct 31, 2026) | Drops Python 3.10; lowercases the content type in parse_options_header. | Anyone on 3.10: pip stops at 0.0.32. |
| 0.0.34 (Nov 16, 2026) | Parsers stop sharing default callbacks; malformed padding raises MultipartParseError. | Code that built several parsers without callbacks. |
The examples in the sections below were run on both versions, in Python 3.12.15 venvs, on November 28, 2026. The outputs are what printed, wrapped where a line was too long.
How do I upgrade python-multipart safely?
Upgrade in one step, not release by release, and test the three things that changed for real apps. This is the order I'd do it in:
- Check your Python.
python --versionmust print 3.11 or later for 0.0.33 and 0.0.34. On 3.10 the newest you can get is 0.0.32; on 3.9, 0.0.20. - Find who pulls it in:
pip show python-multipartlists it under Required-by. FastAPI'sstandardextra and Starlette'sfullextra both ask forpython-multipart>=0.0.18(PyPI metadata for fastapi 0.165.0), so a fresh install already gets 0.0.34. - Search your code for the removed pieces:
git grep -n trust_x_headersandgit grep -n FileClass. Both are gone. - Search your clients and tests for form bodies that use
;between fields. Change them to&. - Pin the new version:
python-multipart==0.0.34in requirements.txt, or"python-multipart>=0.0.34"in pyproject.toml. - Run your upload and form tests, then
pip-auditto confirm the advisories are gone (shown below).
Because the major version is still 0, every release here is allowed to break things under SemVer. A range like ~=0.0.20 still allows every 0.0.x release from 0.0.20 up, so it lets all of these changes in. The caret vs tilde guide covers how 0.0.x ranges behave.
Why does pip stop at python-multipart 0.0.20?
Because your Python is 3.9 or older. 0.0.20 declares requires_python >=3.8, 0.0.21 to 0.0.32 declare >=3.10, and 0.0.33 and 0.0.34 declare >=3.11 on PyPI. pip hides releases your interpreter can't run, so the upgrade looks like it doesn't exist:
$ python3 --version
Python 3.9.6
$ pip install python-multipart==0.0.34
ERROR: Could not find a version that satisfies
the requirement python-multipart==0.0.34
(from versions: 0.0.1, 0.0.2, ... 0.0.20)
ERROR: No matching distribution found for
python-multipart==0.0.34(Lines wrapped and the version list shortened; pip printed every version from 0.0.1 to 0.0.20.) That's also why so many searches ask about 0.0.20 to 0.0.34 specifically: 0.0.20 is the last release for Python 3.8 and 3.9. Python 3.10 itself reached end of life on October 1, 2026, per endoflife.date, and fastapi 0.165.0 and starlette 1.10.0 also require 3.11. The Python end-of-life calendar lists the dates for every version.
Does python-multipart still split form fields on semicolons?
No. Since 0.0.30, only & separates fields in an application/x-www-form-urlencoded body, following the WHATWG URL standard (PR #290). Older versions also split on ;, which let a client hide one field inside another (GHSA-6jv3-5f52-599m). There's no setting to turn the old behavior back on.
Here's what that does to a FastAPI form. The app takes a user and an optional role:
@app.post("/login")
def login(user: Annotated[str, Form()],
role: Annotated[str, Form()] = "member"):
return {"user": user, "role": role}
c.post("/login", content=b"user=ann;role=admin",
headers={"content-type":
"application/x-www-form-urlencoded"})Run with fastapi 0.165.0 and each python-multipart version, the same request prints:
0.0.20 200 {'user': 'ann', 'role': 'admin'}
0.0.34 200 {'user': 'ann;role=admin', 'role': 'member'}Both return 200, so nothing fails loudly. On 0.0.34 the role falls back to its default and the user value holds the rest of the string. If a client of yours builds form bodies by hand with semicolons, change it to &; browsers and HTTP libraries already use &. Feeding python-multipart's own FormParser directly gives the same split (two of the five bodies I tried):
== 0.0.20
b'a=1;b=2' -> [(b'a', b'1'), (b'b', b'2')]
b';admin=1' -> [(b'admin', b'1')]
== 0.0.34
b'a=1;b=2' -> [(b'a', b'1;b=2')]
b';admin=1' -> [(b';admin', b'1')]Which python-multipart APIs were removed?
Two. The trust_x_headers argument of create_form_parser, and the X-File-Name header it read, went in 0.0.23 (PR #196). Passing it now raises a TypeError:
pm.create_form_parser(
{"Content-Type": b"application/octet-stream"},
None, lambda f: None, trust_x_headers=True)
== 0.0.20
3 trust_x_headers: accepted
== 0.0.34
3 trust_x_headers: create_form_parser() got an
unexpected keyword argument 'trust_x_headers'The fix is to delete the argument. If you relied on X-File-Name for a raw upload, read the header in your own handler and pass the name on yourself. Then 0.0.25 removed custom FormParser classes (PR #257): the FileClass and FieldClass hooks are gone, so wrap the File or Field objects your callback receives instead.
One thing that did not go: the old import multipart name. It still works on 0.0.34 and still warns, the same as on 0.0.20:
$ python -W always -c "import multipart"
<string>:1: PendingDeprecationWarning: Please
use `import python_multipart` instead.(Wrapped to fit.) Switch to import python_multipart now. The old name exists because another PyPI package is also called multipart, and per PR #166 the shim steps aside when that package is installed, so import multipart then loads the other project.
What changed for file uploads in python-multipart?
With UPLOAD_KEEP_FILENAME on, 0.0.22 and later keep the file inside UPLOAD_DIR. Before 0.0.22, a filename with a path in it could write somewhere else (GHSA-wp53-j4wj-2cfg, high). I sent filename="../escape.txt" with UPLOAD_DIR set to a folder called up, and listed the parent folder and up after each run:
== 0.0.20
4 file_name: b'../escape.txt'
4 on disk: ['escape', 'up'] []
== 0.0.34
4 file_name: b'../escape.txt'
4 on disk: ['up'] ['escape']On 0.0.20 the file landed next to up instead of in it. On 0.0.34 it stays in up. Note the second line: File.file_name still holds what the client sent on both versions. If you build a path from it yourself, strip it first with os.path.basename.
Smaller upload changes, per the changelog: File objects carry the part's MIME type (0.0.25), a new UPLOAD_DELETE_TMP option controls temp-file cleanup (0.0.25), and uploads with no filename no longer crash when UPLOAD_KEEP_FILENAME or UPLOAD_KEEP_EXTENSIONS is set (0.0.33).
Which requests does python-multipart 0.0.34 reject or parse differently?
Malformed and oversized ones. A boundary longer than 256 bytes now fails (0.0.28, PR #282):
pm.MultipartParser(b"x" * 300)
== 0.0.20
5 long boundary: accepted
== 0.0.34
5 long boundary: FormParserError Boundary length
300 exceeds maximum of 256Header parsing changed too. parse_options_header ignores the RFC 2231 extended parameters filename* and name* since 0.0.30 (PR #291), so the plain filename wins, and it lowercases a content type that has parameters since 0.0.33:
h = b"form-data; name=f; filename=a.txt; "
b"filename*=UTF-8''evil.php"
parse_options_header(
b"Multipart/Form-Data; boundary=abc")
== 0.0.20
3 options: (b'form-data', {b'name': b'f',
b'filename': b'evil.php'})
4 ctype: b'Multipart/Form-Data'
== 0.0.34
3 options: (b'form-data', {b'name': b'f',
b'filename': b'a.txt'})
4 ctype: b'multipart/form-data'If you compare content types with ==, the lowercase result is the safer one to compare against. The rest, from the 0.0.34 release notes and the changelog: part headers have size limits (0.0.27), data after the closing boundary is dropped (0.0.26), a negative Content-Length is rejected by parse_form (0.0.31), spaces and tabs after a boundary between parts count as padding and malformed padding raises MultipartParseError (0.0.34), and parse_options_header trims only spaces and tabs (0.0.34).
One addition you may want: 0.0.33 added opt-in MAX_FIELDS and MAX_FIELD_SIZE options for URL-encoded forms in FormParser. Per the 0.0.33 release notes, both default to no limit, so nothing changes until you set them.
Do python-multipart parsers still share callbacks?
Not since 0.0.34. Before it, parsers built without a callbacks argument all used the same default dictionary, so set_callback() on one changed every other one (PR #362):
a = pm.MultipartParser(b"xx")
b = pm.MultipartParser(b"xx")
a.set_callback("end", lambda: None)
print("2 b.callbacks:", list(b.callbacks))
== 0.0.20
2 b.callbacks: ['on_end']
== 0.0.34
2 b.callbacks: []Some summaries call this a breaking change for code that relies on shared callbacks. In practice the old behavior was a bug: two parsers in the same process could end up calling each other's handlers. If your code worked by accident because of it, pass the callbacks to each parser when you create it.
Which python-multipart vulnerabilities does upgrading fix?
Seven GitHub advisories affect 0.0.20, three of them high. All are fixed by 0.0.31, and 0.0.34 has none:
| Advisory | Severity, fixed in | What it was |
|---|---|---|
| GHSA-wp53-j4wj-2cfg (CVE-2026-24486) | High, 0.0.22 | Upload written outside UPLOAD_DIR with UPLOAD_KEEP_FILENAME on |
| GHSA-mj87-hwqh-73pj (CVE-2026-40347) | Medium, 0.0.26 | Denial of service from a large preamble or epilogue |
| GHSA-pp6c-gr5w-3c5g (CVE-2026-42561) | High, 0.0.27 | Denial of service from unbounded part headers |
| GHSA-5rvq-cxj2-64vf (CVE-2026-53539) | High, 0.0.30 | Quadratic-time parsing of bodies with semicolons |
| GHSA-6jv3-5f52-599m (CVE-2026-53538) | Low, 0.0.30 | Field smuggling through ; as a separator |
| GHSA-vffw-93wf-4j4q (CVE-2026-53537) | Low, 0.0.30 | Content-Disposition smuggling through filename* |
| GHSA-v9pg-7xvm-68hf (CVE-2026-53540) | Low, 0.0.31 | Negative Content-Length buffers the whole body |
To check your own environment, run pip-audit against your requirements. pip-audit 2.10.1 on python-multipart==0.0.20 printed this (it listed each ID twice; I left the repeats out):
$ pip-audit -r req.txt
Found 12 known vulnerabilities in 1 package
Name Version ID Fix Versions
python-multipart 0.0.20 PYSEC-2026-1852 0.0.22
python-multipart 0.0.20 PYSEC-2026-3038 0.0.26
python-multipart 0.0.20 PYSEC-2026-3039 0.0.27
python-multipart 0.0.20 PYSEC-2026-3040 0.0.31
python-multipart 0.0.20 PYSEC-2026-3036 0.0.30
python-multipart 0.0.20 PYSEC-2026-3037 0.0.30The same command on python-multipart==0.0.34 printed "No known vulnerabilities found". If you're stuck on Python 3.10, 0.0.32 has every one of these fixes; on 3.9 there's no fixed release, which is the strongest reason to move off 3.9.
Where Since.dev fits
Since.dev keeps a python-multipart breaking changes page that lists the releases that changed behavior, such as 0.0.33 dropping Python 3.10, each with its source, so you don't have to read 14 changelog entries to find them.
For the general method behind this page (list the releases in between, read the notes, run both versions), see how to find breaking changes between two versions and how to check dependencies before you upgrade. To see what a public repository is exposed to, run a free scan, or give your coding agent the same answers through the docs.
When a change like this reaches a repository you connect, Since.dev reports where your code is affected and can open a pull request with the fix for you to review. Nothing merges or deploys on its own.
Questions
What is the latest version of python-multipart?
0.0.34, released November 16, 2026, per its PyPI page and changelog. It needs Python 3.11 or later. On Python 3.10 the newest release you can install is 0.0.32, and on Python 3.9 it's 0.0.20.
Is python-multipart 0.0.20 vulnerable?
Yes. Seven GitHub advisories published in 2026 affect it, three rated high: an upload path issue fixed in 0.0.22 and two denial-of-service issues fixed in 0.0.27 and 0.0.30. Upgrading to 0.0.31 or later fixes all seven, and pip-audit reports none for 0.0.34.
Does FastAPI need python-multipart?
Yes, for Form and File parameters. FastAPI raises an error that says form data requires python-multipart to be installed when you declare one without it. The fastapi[standard] extra installs it, asking for version 0.0.18 or later, so a new install gets 0.0.34 on Python 3.11 and up.
Why are my FastAPI form fields merged after upgrading python-multipart?
Your client separates fields with semicolons. Since python-multipart 0.0.30, only the ampersand separates URL-encoded fields, so user=ann;role=admin becomes one field called user. Change the client to use the ampersand; there's no option to restore the old split.
Is python-multipart the same package as multipart?
No. They're two different PyPI projects that both used the import name multipart. python-multipart moved to import python_multipart in 0.0.13 and keeps import multipart working with a PendingDeprecationWarning, which 0.0.34 still prints. If the other multipart package is installed too, import multipart loads that one instead, so use import python_multipart.
Related guides
Free tools
- Runtime end-of-life checker for Docker, CI and LambdaPaste a Dockerfile, workflow, go.mod, package.json or .csproj and see when each Node.js, Python, .NET or runner version reaches end of life. Free.
How-to
- cryptography 50.0.0 and 51.0.0 breaking changes, testedWhat breaks when you upgrade Python cryptography to 50.0.0 or 51.0.0: new FFDH and DSA warnings, stricter X.509, the pyOpenSSL pin. Tested on four versions.
- google-auth 2.56.2 breaking change: the service account email check, testedgoogle-auth 2.56.2 only runs the Regional Access Boundary lookup for .gserviceaccount.com emails, and 2.63.0 turns it off by default. Tested on three versions.
- How to find the breaking changes between two versions of a packageHow to find breaking changes between two versions of a package: list the releases in between, read each changelog, diff the code. Commands for npm, PyPI, Go.
- How to check your dependencies for breaking changes before you upgradeHow to check dependencies for breaking changes before upgrading: the commands, a real failing upgrade, CI that fails on deprecations, and where notices appear.
- boto3 1.44.0 breaking changes: the new retry default, testedboto3 1.44.0 makes standard retries the default: 3 attempts instead of 5, much shorter waits, and bearer tokens need HTTPS. Tested on both versions.
Explainers
- Caret vs tilde in package.json: what ^ and ~ let inCaret (^) allows minor and patch updates, tilde (~) only patches. The 0.x exception, what your lockfile does, and how ^ and ~ differ in Cargo and Composer.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.