One function
MultipartPart in defnull/multipart
The author described this change as “fix: Closing a MultipartPart should set its file to None, not False.”. It counts as a record because the check below fails on the code as it stood at 093a60b0a and passes on f6ad3a7ca, with nothing else changed between the two runs.
Projectdefnull/multipart
Fix saved2025-01-21
Sharing licenceMIT · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a docstring
A :class:`MultipartPart` represents a fully parsed multipart part and provides convenient access to part headers and other details (e.g. :attr:`name` and :attr:`filename`) as well as its memory- or disk-buffered binary or text content.
The change
| 114 | 114 | """ Close :attr:`file` and set it to `None` to free up resources. """ | |
| 115 | 115 | if self.file: | |
| 116 | 116 | self.file.close() | |
| 117 | - | self.file = False | |
| 117 | + | self.file = None |
The check that tells the two apart
fail→pass·test/test_legacy_parser.py::TestMultipartParser::test_segment_close
Check file test/test_legacy_parser.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it093a60b0a83f8a3339d38faa30c2cdccb94558ff
Broken version dated2024-12-02
Modulemultipart
Units changedMultipartPart
Fingerprint036836da9ce9f239
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in defnull/multipart
- 2026-03-09change: Raise ParserStateError on invalid boundaries.
- 2025-07-26fix: Hardened header parsing.
- 2024-09-28fix: Allow empty segment names
- 2024-08-26parse_form_data
- 2024-08-26fix: Properly handle completely empty input stream.