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.

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

114114 """ Close :attr:`file` and set it to `None` to free up resources. """
115115 if self.file:
116116 self.file.close()
117- self.file = False
117+ self.file = None

The check that tells the two apart

failpass·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