mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 11:49:10 +00:00
[hotfix] fixes for UnicodeDecodeError (#10620)
This commit is contained in:
committed by
Nabin Hait
parent
5096c45dec
commit
de278635a3
@@ -78,6 +78,7 @@ def get_chart(chart_template, existing_company=None):
|
|||||||
for folder in folders:
|
for folder in folders:
|
||||||
path = os.path.join(os.path.dirname(__file__), folder)
|
path = os.path.join(os.path.dirname(__file__), folder)
|
||||||
for fname in os.listdir(path):
|
for fname in os.listdir(path):
|
||||||
|
fname = frappe.as_unicode(fname)
|
||||||
if fname.endswith(".json"):
|
if fname.endswith(".json"):
|
||||||
with open(os.path.join(path, fname), "r") as f:
|
with open(os.path.join(path, fname), "r") as f:
|
||||||
chart = f.read()
|
chart = f.read()
|
||||||
@@ -105,6 +106,7 @@ def get_charts_for_country(country):
|
|||||||
path = os.path.join(os.path.dirname(__file__), folder)
|
path = os.path.join(os.path.dirname(__file__), folder)
|
||||||
|
|
||||||
for fname in os.listdir(path):
|
for fname in os.listdir(path):
|
||||||
|
fname = frappe.as_unicode(fname)
|
||||||
if (fname.startswith(country_code) or fname.startswith(country)) and fname.endswith(".json"):
|
if (fname.startswith(country_code) or fname.startswith(country)) and fname.endswith(".json"):
|
||||||
with open(os.path.join(path, fname), "r") as f:
|
with open(os.path.join(path, fname), "r") as f:
|
||||||
_get_chart_name(f.read())
|
_get_chart_name(f.read())
|
||||||
|
|||||||
Reference in New Issue
Block a user