Skip to content

Fix: Correct slice index calculation in ApplyXMLMixin#325

Merged
vicsanity623 merged 1 commit into
mainfrom
pyob-evolution-v1-1779960205
May 28, 2026
Merged

Fix: Correct slice index calculation in ApplyXMLMixin#325
vicsanity623 merged 1 commit into
mainfrom
pyob-evolution-v1-1779960205

Conversation

@pyob-bot
Copy link
Copy Markdown
Collaborator

Summary of Changes

Updated the slice index calculation in src/pyob/xml_mixin.py to use search_lines_stripped instead of search_lines when calculating the end index for code replacement. This ensures that the slice correctly accounts for the length of the stripped lines, preventing potential index misalignment during code modification.

Technical Impact

  • Correctness: Resolves an off-by-one or length mismatch error that could occur when the length of the stripped search lines differs from the original search lines.
  • Stability: Improves the reliability of the XML-based code patching mechanism by ensuring the replacement logic accurately targets the intended block of code.

@vicsanity623 vicsanity623 merged commit da13280 into main May 28, 2026
1 check passed
@vicsanity623 vicsanity623 deleted the pyob-evolution-v1-1779960205 branch May 28, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants