Skip to content

fix: treat write_text linesep as a literal separator#248

Open
santhreal wants to merge 1 commit into
jaraco:mainfrom
santhreal:fix/write-text-literal-linesep
Open

fix: treat write_text linesep as a literal separator#248
santhreal wants to merge 1 commit into
jaraco:mainfrom
santhreal:fix/write-text-literal-linesep

Conversation

@santhreal

@santhreal santhreal commented Jul 18, 2026

Copy link
Copy Markdown

Path.write_text hits re.error when linesep-backslash-regex-template. This PR fixes the regression with a focused test covering the case.

U_NEWLINE.sub passed linesep as a regex replacement template, so
values like \\1 raised re.error and \\n was expanded instead of
written literally.
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.

1 participant