pypi / python-multipart
python-multipart
What changed in python-multipart 0.0, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
11 breaking10 security2 new APIs and options5 performance1 behavior and defaults9 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpython-multipart 0.038 changes
Breaking changes 11
Spaces and tabs after delimiters between parts are recognized as transport padding; malformed padding raises MultipartParseError instead of being returned as part data. Padded opening boundaries remain unsupported.
Content types with parameters are lowercased, so Multipart/Form-Data; boundary=abc returns multipart/form-data.
Python 3.11 is now the minimum supported version; Python 3.10 is no longer supported.
Ignores RFC 2231 extended parameters when parsing options headers.
Only
&is treated as the urlencoded field separator.Preamble data before the first multipart boundary is skipped.
Custom
FormParserclasses are removed.The unused trust_x_headers parameter was removed.
The X-File-Name fallback was removed.
The filename no longer includes the directory path, changing the value developers receive from File.
Adds support for Python 3.14 and drops support for end-of-life Python 3.8 and 3.9.
Security 10
Transfer-encoding decoders are finalized at the end of each part, and quoted-printable escapes split across writes decode correctly before callbacks run.
FormParser accepts the opt-in MAX_FIELD_SIZE option to cap URL-encoded fields while streaming; it raises FormParserError before oversized data is buffered.
FormParser accepts the opt-in MAX_FIELDS option to cap URL-encoded fields while streaming; it raises FormParserError before oversized data is buffered.
Header field name size is bounded before validation.
parse_form validates that Content-Length is non-negative.
python-multipart: Quadratic-time querystring parsing with semicolon separators causes CPU denial of service
Multipart boundary length is capped at 256 bytes.
python-multipart has Denial of Service via unbounded multipart part headers
python-multipart affected by Denial of Service via large multipart preamble or epilogue data
Python-Multipart has Arbitrary File Write via Non-Default Configuration
New APIs and options 2
Adds MIME content type information to
File.Adds
UPLOAD_DELETE_TMPtoFormParserconfiguration.
Performance 5
Parsing forms with many fields has less overhead because complete CRLF sequences are consumed without stepping through each intermediate parser state, and mark-helper functions are not created on each write.
Parsing is faster because the parser reuses separator positions and starts the next field directly when its data is already available.
Complete boundaries are matched in one step, making opening boundary matching faster.
Multipart header parsing and callback dispatch are faster.
The partial-boundary tail scan is faster through use of bytes.find.
Behavior and default changes 1
Epilogue data after the closing boundary is silently discarded.
Fixes and other changes 9
Parsers constructed without callbacks now get separate dictionaries, so calling
set_callback()on one no longer changes another parser's handlers.The function trims only spaces and tabs, preserving non-ASCII parameter bytes such as UTF-8 bytes for à.
Uploads without a filename no longer raise AttributeError when spilled to disk with UPLOAD_KEEP_EXTENSIONS or UPLOAD_KEEP_FILENAME set.
A str upload directory works with UPLOAD_KEEP_FILENAME instead of failing on the first write to disk.
Handles malformed RFC 2231 continuations.
CTE values are handled case-insensitively.
A trailing bare field name now emits
field_endwhen finalized.Multipart headers are handled case-insensitively.
parse_form() now validates chunk_size.