]> code.ossystems Code Review - openembedded-core.git/commitdiff
send-error-report: encode data to bytes python3
authorEd Bartosh <ed.bartosh@linux.intel.com>
Fri, 3 Jun 2016 09:04:22 +0000 (12:04 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 3 Jun 2016 12:12:45 +0000 (13:12 +0100)
Encoded data before sending it through http as urllib expecting bytes.
Fixed TypeError: POST data should be bytes or an iterable of bytes. It
cannot be of type str.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/send-error-report

index ff23552b66c27875262d897f466513b2efb1502c..15b5e849119e27264e2b2edc05632b24648fc44d 100755 (executable)
@@ -125,7 +125,7 @@ def prepare_data(args):
         with open(args.error_file, 'r') as json_fp:
             data = json_fp.read()
 
-    return data
+    return data.encode('utf-8')
 
 
 def send_data(data, args):