ci: Corrected line encoding in Python scripts #3679
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
This PR follows on #3677 because even though we don't need to execute release.py when packing the package (due to existing pvp exception) nor vetting test job (uses upm-ci which does not run PVP checks) we should future proof release.py and similar scripts from making this mistake.
The main reason why the release.py was causing the package pack to fail on windows is that when you open a file in text mode ('w') on Windows, Python's default behavior is to convert each newline character (\n) into the platform's standard line separator, which is \r\n (CRLF). This can cause inconsistencies when the file is used in environments that expect \n (LF), such as Git.
The solution was to ensure that we are specifying the newline like
with open(path, 'w', encoding='UTF-8', newline='\n') as file:
Jira ticket
N/A
Documentation
N/A
Testing & QA (How your changes can be verified during release Playtest)
PR trigger check was green and I verified that when release.py command was included in pack job the results were green (see THIS job)
Backports
Backport to
develop
branch in #3681