From b53859db50fe8bdcc6a24cc91c35d16bee8b9eb1 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 21 Jan 2021 21:23:49 +0100 Subject: [PATCH] [fix] python3: fix yunopaste encoding --- src/yunohost/utils/yunopaste.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/yunohost/utils/yunopaste.py b/src/yunohost/utils/yunopaste.py index 9a406a580..5afb865cd 100644 --- a/src/yunohost/utils/yunopaste.py +++ b/src/yunohost/utils/yunopaste.py @@ -20,6 +20,8 @@ def yunopaste(data): except Exception as e: logger.warning("For some reason, YunoHost was not able to anonymize the pasted data. Sorry about that. Be careful about sharing the link, as it may contain somewhat private infos like domain names or IP addresses. Error: %s" % e) + data = data.encode() + try: r = requests.post("%s/documents" % paste_server, data=data, timeout=30) except Exception as e: