Skip to content

Conversation

@pgjones
Copy link
Member

@pgjones pgjones commented Dec 23, 2025

This adjusts b1916c0 by ensuring CR, \r, are not ignored if an earlier LR, \n, is present when considering if a partial boundary can exist. This would result in trailing CR, \r, being added to the data rather than part of a potential partial boundary.

This correctly fixes #3065 and fixes #3077.

@pgjones pgjones mentioned this pull request Dec 23, 2025
@davidism davidism added this to the 3.1.5 milestone Jan 2, 2026
This adjusts b1916c0 by ensuring CR,
\r, are not ignored if an earlier LR, \n, is present when considering
if a partial boundary can exist. This would result in trailing CR, \r,
being added to the data rather than part of a potential partial
boundary.
@davidism davidism changed the base branch from main to stable January 2, 2026 18:56
@davidism davidism merged commit 0f76c35 into pallets:stable Jan 2, 2026
13 checks passed
def _last_partial_boundary_index(self, data: bytes | bytearray) -> int:
# Find the last index following which a partial boundary
# could be present in the data. This will be the earliest
# position of a LR or a CR, unless that position is more
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pgjones @davidism nitpicky, but: I think LR was probably intended to be LF in this comment?

Suggested change
# position of a LR or a CR, unless that position is more
# position of a LF or a CR, unless that position is more

@johan-bjareholt
Copy link

johan-bjareholt commented Jan 19, 2026

Is it possible that this change created the following bug? #3088
Seems very related at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants