From de278635a3a75d43893120e1b52a8c36e921156a Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Thu, 31 Aug 2017 13:36:56 +0530 Subject: [PATCH] [hotfix] fixes for UnicodeDecodeError (#10620) --- .../doctype/account/chart_of_accounts/chart_of_accounts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py index adb7bc1338..1e694e7e3a 100644 --- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py @@ -78,6 +78,7 @@ def get_chart(chart_template, existing_company=None): for folder in folders: path = os.path.join(os.path.dirname(__file__), folder) for fname in os.listdir(path): + fname = frappe.as_unicode(fname) if fname.endswith(".json"): with open(os.path.join(path, fname), "r") as f: chart = f.read() @@ -105,6 +106,7 @@ def get_charts_for_country(country): path = os.path.join(os.path.dirname(__file__), folder) for fname in os.listdir(path): + fname = frappe.as_unicode(fname) if (fname.startswith(country_code) or fname.startswith(country)) and fname.endswith(".json"): with open(os.path.join(path, fname), "r") as f: _get_chart_name(f.read())