From 67132f775cd3dde17877ea30b5228d856d93df47 Mon Sep 17 00:00:00 2001 From: Achilles Rasquinha Date: Mon, 12 Mar 2018 14:31:04 +0530 Subject: [PATCH] bytes to string --- frappe/utils/file_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frappe/utils/file_manager.py b/frappe/utils/file_manager.py index f3d7284a44..18990a48c5 100644 --- a/frappe/utils/file_manager.py +++ b/frappe/utils/file_manager.py @@ -110,7 +110,7 @@ def save_url(file_url, filename, dt, dn, folder, is_private, df=None): def get_uploaded_content(): # should not be unicode when reading a file, hence using frappe.form if 'filedata' in frappe.form_dict: - if b"," in frappe.form_dict.filedata: + if "," in frappe.form_dict.filedata: frappe.form_dict.filedata = frappe.form_dict.filedata.rsplit(",", 1)[1] frappe.uploaded_content = base64.b64decode(frappe.form_dict.filedata) frappe.uploaded_filename = frappe.form_dict.filename @@ -124,7 +124,7 @@ def save_file(fname, content, dt, dn, folder=None, decode=False, is_private=0, d if isinstance(content, text_type): content = content.encode("utf-8") - if b"," in content: + if "," in content: content = content.split(",")[1] content = base64.b64decode(content)