You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use subprocess.run + universal_newlines=True (#5843)
* explicit utf-8 environment
...as the Ubuntu images on Docker defaults to LANG=C (ascii)
* python 3 style run_process utility
* split by \n when universal_newlines
* use run_process in many places
# Important to write out in binary mode, because the data we are writing contains Windows line endings '\r\n' because it was PIPED from console.
55
-
# Otherwise writing \r\n to ascii mode file will result in Windows amplifying \n to \r\n, generating bad \r\r\n line endings.
56
-
f=open(filename, 'wb')
54
+
f=open(filename, 'w')
57
55
f.write(output)
58
56
f.close()
59
57
ifDEBUGandnotshared.WINDOWS: print('.', file=sys.stderr) # Skip debug progress indicator on Windows, since it doesn't buffer well with multiple threads printing to console.
# Important to write out in binary mode, because the data we are writing contains Windows line endings '\r\n' because it was PIPED from console.
299
-
# Otherwise writing \r\n to ascii mode file will result in Windows amplifying \n to \r\n, generating bad \r\r\n line endings.
300
-
f=open(filename, 'wb')
298
+
f=open(filename, 'w')
301
299
f.write(output)
302
300
f.close()
303
301
ifDEBUGandnotshared.WINDOWS: print('.', file=sys.stderr) # Skip debug progress indicator on Windows, since it doesn't buffer well with multiple threads printing to console.
0 commit comments