UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 19: ordinal not in range(128)

If I chose a new company then I get this message:

Please type some additional information that could help us reproduce this issue:
App Versions

{
“erpnext”: “8.9.0”,
“frappe”: “8.8.0”
}

Route

Form/Company/Új Vállalkozás 1

Error Report

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 56, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 52, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 922, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py”, line 108, in get_charts_for_country
if (fname.startswith(country_code) or fname.startswith(country)) and fname.endswith(“.json”):
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 19: ordinal not in range(128)

Request Data

{
“type”: “POST”,
“args”: {
“country”: “Hungary”,
“cmd”: “erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country”
},
“url”: “/”
}

Response JSON

{}


May be the use of the á, é ,í , ó ú ű ö in the translated text causing problem?

@krnkris,

Yes using such characters can cause the UnicodeDecodeError try renaming company without special characters

@makarand_b

Something changed, because if I want to add new company I get these errors immediately:

Please type some additional information that could help us reproduce this issue:
App Versions

{
“erpnext”: “8.9.1”,
“frappe”: “8.8.3”
}

Route

Form/Company/Új Vállalkozás 1

Error Report

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 56, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 52, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 922, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py”, line 108, in get_charts_for_country
if (fname.startswith(country_code) or fname.startswith(country)) and fname.endswith(“.json”):
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 19: ordinal not in range(128)

Request Data

{
“type”: “POST”,
“args”: {
“country”: “Hungary”,
“cmd”: “erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country”
},
“url”: “/”


App Versions

{
“erpnext”: “8.9.1”,
“frappe”: “8.8.3”
}

Route

Form/Company/Új Vállalkozás 1

Error Report

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 56, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 52, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 922, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py”, line 108, in get_charts_for_country
if (fname.startswith(country_code) or fname.startswith(country)) and fname.endswith(“.json”):
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 19: ordinal not in range(128)

Request Data

{
“type”: “POST”,
“args”: {
“country”: “Hungary”,
“cmd”: “erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country”
},
“url”: “/”
}


Please help.

Same problem:

++++++
Chart of accounts ID is empty

Exactly - The Chart of accounts ID is empty when setting up new company after step 4 and on landing on step 5 you get the above error.

I have also checked again with only latin letters for company name and abbreviation, but it still gives the error and the Chart of accounts ID on the next step 5 is empty.

I have downloaded today and used the latest VM production image from: https://erpnext.com/download
This one: http://build.erpnext.com/ERPNext-Production.ova

When the company selection and/or the setup procedure is not in english or latin language then we get this error.

This is from today update.

Not exactly.
I am working in English now.
If I go to create new company:
[http://localhost:8080/desk#Form/Company/New Company 1]
I got the same error immediately once I press the “New” button in the company list - BUT still I have one existing company with non-latin characters in the name.

App Versions

{
“erpnext”: “8.9.0”,
“frappe”: “8.8.0”
}
Route

Form/Company/New Company 1
Error Report

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 56, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 52, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 922, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py”, line 108, in get_charts_for_country
if (fname.startswith(country_code) or fname.startswith(country)) and fname.endswith(“.json”):
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 19: ordinal not in range(128)
Request Data

{
“type”: “POST”,
“args”: {
“country”: “Bulgaria”,
“cmd”: “erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country”
},
“url”: “/”
}
Response JSON

{}

Maybe I need to do a full refresh and setup a whole new VM without data, but since I’ve setup some test data I cannot do it now.

@alexgs

Did you tried to delete the existing company or rename with latin letters?

Did you tried a brand new VM setup with only English language + latin letters?

Strange we do not have anything in Chart of accounts…

Just tried in brand new VM from the .ova downloaded today. I used English as setup language. The same problem repeats. Even if I select UK as country, company name is nnnnnnn, company abbreviation is N, and the errror is shown and no Chart of account option is available in the Setup wizard.

@alexgs

Than you for your effort.

Now we should wait for a professional ,
to taking care about this issue.

Can someone please post this with relevant details on Issues · frappe/erpnext · GitHub ?

Found the source of this problem, it is a file called fr_plan_comptable_général.json in the folder erpnext/erpnext/accounts/doctype/account/chart_of_accounts/verified.

os.listdir() is throwing a error when reading this file name, I deleted this file and was able to proceed with the setup.

@rmehta , will try and put details on github issues.

Submitted issue: Unable to finish Erpnext setup : UnicodeDecodeError · Issue #10540 · frappe/erpnext · GitHub

@nabinhait, @rmehta

OK here is the solution:

Please rename the
fr_plan_comptable_général.json
to
fr_plan_comptable_general.json

on terminal
mv fr_plan_comptable_général.json fr_plan_comptable_general.json

Please update the file name on the Production Master + Develop.
Thank you!

@krnkris can you please update the github issue or better, send a pull request. Thanks!

@rmehta
Done:

https://github.com/frappe/erpnext/pull/10601

Please close this subject.

1 Like