diff mbox series

[U-Boot] patman: Fix cc-cmd option for Python 3

Message ID 20191107161429.116770-1-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show
Series [U-Boot] patman: Fix cc-cmd option for Python 3 | expand

Commit Message

Simon Glass Nov. 7, 2019, 4:14 p.m. UTC
The Python 3 conversion doesn't work correctly with the new patch to use
NUL as the separator in the CC file.

Fix this by avoiding encoding the CC list written to the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/patman/patman.py | 2 +-
 tools/patman/series.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/patman/patman.py b/tools/patman/patman.py
index cf53e532dd..ca209c276d 100755
--- a/tools/patman/patman.py
+++ b/tools/patman/patman.py
@@ -107,7 +107,7 @@  elif options.test:
 # Called from git with a patch filename as argument
 # Printout a list of additional CC recipients for this patch
 elif options.cc_cmd:
-    fd = open(options.cc_cmd, 'r')
+    fd = open(options.cc_cmd, 'r', encoding='utf-8')
     re_line = re.compile('(\S*) (.*)')
     for line in fd.readlines():
         match = re_line.match(line)
diff --git a/tools/patman/series.py b/tools/patman/series.py
index 02a1113ad0..a15f7625ed 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -251,7 +251,7 @@  class Series(dict):
             cover_cc = [tools.FromUnicode(m) for m in cover_cc]
             cc_list = '\0'.join([tools.ToUnicode(x)
                                  for x in sorted(set(cover_cc + all_ccs))])
-            print(cover_fname, cc_list.encode('utf-8'), file=fd)
+            print(cover_fname, cc_list, file=fd)
 
         fd.close()
         return fname