Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hotfix] Encoding correction #15877

merged 1 commit into from Nov 1, 2018


None yet
2 participants
Copy link

commented Oct 31, 2018


This PR is to fix an encoding issue in the accounts reports in Staging branch.

Before the fix:

Exact traceback:

Traceback (most recent call last):
  File "/home/frappe/dev-bench/apps/frappe/frappe/", line 61, in application
    response = frappe.handler.handle()
  File "/home/frappe/dev-bench/apps/frappe/frappe/", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/dev-bench/apps/frappe/frappe/", line 56, in execute_cmd
    return, **frappe.form_dict)
  File "/home/frappe/dev-bench/apps/frappe/frappe/", line 1007, in call
    return fn(*args, **newargs)
  File "/home/frappe/dev-bench/apps/frappe/frappe/", line 489, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
  File "/home/frappe/dev-bench/apps/frappe/frappe/desk/", line 174, in run
    result = generate_report_result(report, filters, user)
  File "/home/frappe/dev-bench/apps/frappe/frappe/desk/", line 65, in generate_report_result
    res = frappe.get_attr(method_name)(frappe._dict(filters))
  File "/home/frappe/dev-bench/apps/erpnext/erpnext/accounts/report/profit_and_loss_statement/", line 16, in execute
    ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
  File "/home/frappe/dev-bench/apps/erpnext/erpnext/accounts/report/", line 146, in get_data
    gl_entries_by_account, ignore_closing_entries=ignore_closing_entries
  File "/home/frappe/dev-bench/apps/erpnext/erpnext/accounts/report/", line 345, in set_gl_entries_by_account
    .format("', '".join([frappe.db.escape(d) for d in accounts]))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 59: ordinal not in range(128)

After the fix:


@chdecultot chdecultot requested a review from nabinhait Oct 31, 2018

@nabinhait nabinhait merged commit a89bce0 into frappe:staging-fixes Nov 1, 2018

3 of 4 checks passed

Codacy/PR Quality Review Codacy was unable to analyse your pull request.
Travis CI - Pull Request Build Passed
coverage/coveralls Coverage remained the same at 51.334%
security/snyk - requirements.txt (frappe) No manifest changes detected

deepeshgarg007 added a commit to deepeshgarg007/erpnext that referenced this pull request Nov 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.