skeleton: make create-new-and-noteworthy.py parse properly
Using iter() caused an endless wait loop. There was a check in the loop
but that caused races. io.TextIOWrapper is the better way to do it.
Change-Id: I57dc53b1609b4fee7485443566cce376b14b7721
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/151183
Tested-by: CI Bot
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
Tested-by: Patrick Tasse <patrick.tasse@gmail.com>
diff --git a/skeleton/create-new-and-noteworthy.py b/skeleton/create-new-and-noteworthy.py
index 33fe6a2..54391f2 100755
--- a/skeleton/create-new-and-noteworthy.py
+++ b/skeleton/create-new-and-noteworthy.py
@@ -8,6 +8,7 @@
# http://www.eclipse.org/legal/epl-v10.html
###############################################################################
+import io
import subprocess
import sys
import argparse
@@ -40,11 +41,9 @@
cmd = ['git', '--no-pager','log', '--after', after, '--until', before]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
commit =""
- for line in iter(proc.stdout.readline, ''):
- if proc.poll() != None:
- break;
+ for line in io.TextIOWrapper(proc.stdout, encoding="utf-8"):
try:
- line = line.strip().decode('UTF-8')
+ line = line.strip()
if (line.startswith("commit")):
commit = line[len("commit "):].strip()
update_report(line)