Is this a regression?
No
Description
Currently line endings is always translated into \n, and patches are rewritten in \n. This can cause diffs to include unchanged parts of the code. Consider setting newline="" when opening files to retain original line endings and to consider the file to be modified for line endings.
Relevant doc: https://docs.python.org/3/library/functions.html#open
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
No response
Anything else?
No response