mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Support UTF-8 messages in git cl upload 🪟
Bug: 1240760 Change-Id: Ib64cd9c9b8c901105f6317bd74b889daa457e4de Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3101520 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This commit is contained in:
@@ -1097,13 +1097,13 @@ def RunEditor(content, git, git_editor=None):
|
||||
if '\r' in content:
|
||||
print(
|
||||
'!! Please remove \\r from your change description !!', file=sys.stderr)
|
||||
fileobj = os.fdopen(file_handle, 'w')
|
||||
fileobj = os.fdopen(file_handle, 'wb')
|
||||
# Still remove \r if present.
|
||||
content = re.sub('\r?\n', '\n', content)
|
||||
# Some editors complain when the file doesn't end in \n.
|
||||
if not content.endswith('\n'):
|
||||
content += '\n'
|
||||
fileobj.write(content)
|
||||
fileobj.write(content.encode('utf-8'))
|
||||
fileobj.close()
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user