-
-
Couldn't load subscription status.
- Fork 44
Ensure README changes don't affect whitespace #296
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
base: main
Are you sure you want to change the base?
Conversation
| # Update first line: "This is Python version X.Y.Z {release_level} N" | ||
| # and update length of underline in second line to match. | ||
| lines = readme.read_text().splitlines() | ||
| lines = readme.read_text(encoding="utf-8").split("\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| lines = readme.read_text(encoding="utf-8").split("\n") | |
| lines = readme.read_text().split("\n") |
I think we can skip this, we have a platform check:
Lines 1375 to 1384 in a8981b1
| if sys.platform not in ("darwin", "linux"): | |
| print( | |
| """\ | |
| WARNING! This script has not been tested on a platform other than Linux and macOS. | |
| Although it should work correctly as long as you have all the dependencies, | |
| some things may not work as expected. As a release manager, you should try to | |
| fix these things in this script so it also supports your platform. | |
| """ | |
| ) |
And there's no RM using Windows now, or next. Perhaps the next one after Savannah will in 2028, but we can deal with it then (along with likely other Windows incompatibilities), and we might be using 3.15 as the minimum by then, with UTF-8 as default.
|
|
||
| original_readme_file = Path(__file__).parent / "README.rst" | ||
| original_contents = original_readme_file.read_text() | ||
| original_contents = original_readme_file.read_text(encoding="utf-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| original_contents = original_readme_file.read_text(encoding="utf-8") | |
| original_contents = original_readme_file.read_text() |
| original_lines = original_contents.splitlines() | ||
| new_lines = readme_file.read_text().splitlines() | ||
| original_lines = original_contents.split("\n") | ||
| new_contents = readme_file.read_text(encoding="utf-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| new_contents = readme_file.read_text(encoding="utf-8") | |
| new_contents = readme_file.read_text() |
str.splitlines()doesn't preserve trailing lines (unless usingkeepends=True), whereasstr.split('\n')does. Use the latter form, and assert that modified files end with a blank line in tests.A