Commit 2081683
authored
ci: Corrected line encoding in Python scripts (#3679)
## 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
#36811 parent 8c964aa commit 2081683
File tree
5 files changed
+8
-8
lines changed- .yamato
- Tools/scripts
- BuildAutomation
- Utils
5 files changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
0 commit comments