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
merged 1 commit into from Nov 1, 2018

Conversation

Projects
None yet
2 participants
@chdecultot
Copy link
Contributor

commented Oct 31, 2018

Hi,

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

Before the fix:
image

Exact traceback:

Traceback (most recent call last):
  File "/home/frappe/dev-bench/apps/frappe/frappe/app.py", line 61, in application
    response = frappe.handler.handle()
  File "/home/frappe/dev-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/dev-bench/apps/frappe/frappe/handler.py", line 56, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/dev-bench/apps/frappe/frappe/__init__.py", line 1007, in call
    return fn(*args, **newargs)
  File "/home/frappe/dev-bench/apps/frappe/frappe/__init__.py", line 489, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
  File "/home/frappe/dev-bench/apps/frappe/frappe/desk/query_report.py", line 174, in run
    result = generate_report_result(report, filters, user)
  File "/home/frappe/dev-bench/apps/frappe/frappe/desk/query_report.py", 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/profit_and_loss_statement.py", line 16, in execute
    ignore_closing_entries=True, ignore_accumulated_values_for_fy= True)
  File "/home/frappe/dev-bench/apps/erpnext/erpnext/accounts/report/financial_statements.py", 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/financial_statements.py", 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:
image

Thanks!

@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.
Details
Travis CI - Pull Request Build Passed
Details
coverage/coveralls Coverage remained the same at 51.334%
Details
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.