From 70c54dc2550084ed022a2f134065a011f37f30aa Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 15 Nov 2019 01:19:03 -0500 Subject: upload/editor: fix bytes/string confusion The upload module tries to turn the strings into bytes before passing to EditString, but it combines bytes & strings causing an error. The return value might be bytes or string, but the caller only expects a string. Lets simplify this by sticking to strings everywhere and have EditString take care of converting to/from bytes when reading/writing the underlying files. This also avoids possible locale confusion when reading the file by forcing UTF-8 everywhere. Bug: https://crbug.com/gerrit/11929 Change-Id: I07b146170c5e8b5b0500a2c79e4213cd12140a96 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/245621 Reviewed-by: David Pursehouse Tested-by: Mike Frysinger --- subcmds/upload.py | 5 ----- 1 file changed, 5 deletions(-) (limited to 'subcmds/upload.py') diff --git a/subcmds/upload.py b/subcmds/upload.py index d0dd3837..5c12aaee 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -271,11 +271,6 @@ Gerrit Code Review: https://www.gerritcodereview.com/ branches[project.name] = b script.append('') - script = [ x.encode('utf-8') - if issubclass(type(x), unicode) - else x - for x in script ] - script = Editor.EditString("\n".join(script)).split("\n") project_re = re.compile(r'^#?\s*project\s*([^\s]+)/:$') -- cgit v1.2.3-54-g00ecf