Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2021
Merged

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

merged 1 commit into from
Sep 17, 2021

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Sep 17, 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.

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
Member Author

cc @ericsnowcurrently

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

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
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