From 293312c0b82aeb4d076d0278b41f954acf942601 Mon Sep 17 00:00:00 2001 From: titipata Date: Sun, 15 Apr 2018 17:46:44 -0400 Subject: [PATCH] Fix error concat byte with string --- lightning/visualization.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lightning/visualization.py b/lightning/visualization.py index e3a0997..a18697c 100644 --- a/lightning/visualization.py +++ b/lightning/visualization.py @@ -41,7 +41,7 @@ def _append_image(self, image): def _append_data(self, data=None, field=None): payload = {'data': data} - headers = {'Content-type': 'application/json', 'Accept': 'text/plain'} + headers = {'Content-type': 'application/json', 'Accept': 'text/plain'} url = self.session.host + '/sessions/' + str(self.session.id) + '/visualizations/' + str(self.id) + '/data/' if field: url += field @@ -51,7 +51,7 @@ def _append_data(self, data=None, field=None): def _update_data(self, data=None, field=None): payload = {'data': data} - headers = {'Content-type': 'application/json', 'Accept': 'text/plain'} + headers = {'Content-type': 'application/json', 'Accept': 'text/plain'} url = self.session.host + '/sessions/' + str(self.session.id) + '/visualizations/' + str(self.id) + '/data/' if field: url += field @@ -194,7 +194,7 @@ def save_html(self, filename=None, overwrite=False): os.remove(filename) with open(filename, "wb") as f: f.write(base.encode('utf-8')) - f.write('') + f.write(b'') @staticmethod def load_template(): @@ -208,5 +208,3 @@ def load_embed(): location = os.path.join(os.path.dirname(__file__), 'lib/embed.js') import codecs return codecs.open(location, "r", "utf-8").read() - -