ci: [Backport] Corrected line encoding in Python scripts#3681
Merged
michalChrobot merged 1 commit intodevelopfrom Sep 17, 2025
Merged
ci: [Backport] Corrected line encoding in Python scripts#3681michalChrobot merged 1 commit intodevelopfrom
michalChrobot merged 1 commit intodevelopfrom
Conversation
michalChrobot
added a commit
that referenced
this pull request
Sep 17, 2025
## 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](https://unity-ci.cds.internal.unity3d.com/job/56280166)** job) ## Backports Backport to `develop` branch in #3681
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Backport of #3679 aiming to fix windows newline encoding when writing to files from automation
Jira ticket
N/A
Documentation
N/A
Testing & QA (How your changes can be verified during release Playtest)
Tested with main PR that is backported here
Backports
This is a backport of #3679