Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] send-error-report: encode data to bytes
@ 2016-06-03  9:04 Ed Bartosh
  0 siblings, 0 replies; only message in thread
From: Ed Bartosh @ 2016-06-03  9:04 UTC (permalink / raw)
  To: openembedded-core

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>
---
 scripts/send-error-report | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/send-error-report b/scripts/send-error-report
index ff23552..15b5e84 100755
--- a/scripts/send-error-report
+++ b/scripts/send-error-report
@@ -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):
-- 
2.1.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-03  9:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-03  9:04 [PATCH] send-error-report: encode data to bytes Ed Bartosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox