Skip to content

bpo-45231: update_file.py preserves end of line#28411

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:newline
Sep 17, 2021
Merged

bpo-45231: update_file.py preserves end of line#28411
vstinner merged 1 commit into
python:mainfrom
vstinner:newline

Conversation

@vstinner

@vstinner vstinner commented Sep 17, 2021

Copy link
Copy Markdown
Member

The update_file.py tool now preserves the end of line of the updated
file. Fix the "make regen-frozen" command: it no longer changes the
end of line of PCbuild/ files on Unix. Git changes the end of line
depending on the platform.

https://bugs.python.org/issue45231

The update_file.py tool now preserves the end of line of the updated
file. Fix the "make regen-frozen" command: it no longer changes the
end of line of PCbuild/ files on Unix. Git changes the end of line
depending on the platform.
@vstinner

Copy link
Copy Markdown
Member Author

cc @ericsnowcurrently

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

That wasn't an obvious fix, so thanks for figuring it out!

@vstinner

Copy link
Copy Markdown
Member Author

Without this change, PCbuild/_freeze_module.vcxproj format is changed on Linux.

With this change, the file is no longer listed in "git status" after "make regen-frozen".

My implementation fails if the source file is empty, but I didn't try to take care of this case, since it doesn't occur currently. It can be fixed later if needed.

@vstinner vstinner deleted the newline branch September 17, 2021 18:13
niyas-sait pushed a commit to niyas-sait/cpython that referenced this pull request Sep 21, 2021
The update_file.py tool now preserves the end of line of the updated
file. Fix the "make regen-frozen" command: it no longer changes the
end of line of PCbuild/ files on Unix. Git changes the end of line
depending on the platform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants