From 100bb5729a98e3cebd65d7138fe08630205be762 Mon Sep 17 00:00:00 2001 From: Dirk Mallunat Date: Fri, 8 Jul 2016 20:42:56 +0200 Subject: fix error with non ascii chars in filename --- fb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fb.py b/fb.py index acfc3e6..7497ee2 100755 --- a/fb.py +++ b/fb.py @@ -99,7 +99,7 @@ class CURLWrapper: def __add_post(self, data): for item in data: for key, value in item.items(): - self.post.append((key, (pycurl.FORM_CONTENTS, value))) + self.post.append((key, (pycurl.FORM_CONTENTS, value.encode('utf-8')))) def getServerConfig(self): if self.serverConfig is None: @@ -151,7 +151,7 @@ class CURLWrapper: for file in chunk: counter+=1 self.post.append( - ("file["+str(counter)+"]", (pycurl.FORM_FILE, file.path)) + ("file["+str(counter)+"]", (pycurl.FORM_FILE, file.path.encode('utf-8'))) ) ret = self.send_post_progress("/file/upload", []) rets["ids"] += ret["ids"] -- cgit v1.2.3-24-g4f1b