Skip to contentSkip to conversation

send-error-report: encode data to bytes

PATCH New Ed Bartosh 1 participant 1 message Jun 3, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 send-error-report: encode data to bytes

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.

---
 scripts/send-error-report | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/send-error-report +1 -1
index ff23552..15b5e84 100755
@@ -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):
Signature · 1 line
2.1.4