From aef6baf798603634a2bc3583d7b5f0fc8dcb86b8 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 31 Mar 2015 13:07:29 +0530 Subject: [PATCH] [hotfix] encode path before removing file --- frappe/utils/file_manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/utils/file_manager.py b/frappe/utils/file_manager.py index e6a61789ed..b3194ecf7c 100644 --- a/frappe/utils/file_manager.py +++ b/frappe/utils/file_manager.py @@ -228,10 +228,14 @@ def delete_file_data_content(doc): def delete_file_from_filesystem(doc): path = doc.file_name + if path.startswith("files/"): path = frappe.utils.get_site_path("public", doc.file_name) else: path = frappe.utils.get_site_path("public", "files", doc.file_name) + + path = encode(path) + if os.path.exists(path): os.remove(path)