I had this crash when clicking on the "Print" button of a Trial balance in a company that has an accentuated character in its name:
2016-05-29 23:02:23,672 1981 INFO absamad werkzeug: 192.168.10.201 - - [29/May/2016 23:02:23] "POST /web/dataset/call_kw/account.journal/read HTTP/1.0" 200 -
2016-05-29 23:02:24,022 1981 WARNING absamad openerp.pooler: openerp.pooler.get_db_and_pool() is deprecated.
2016-05-29 23:02:24,070 1981 WARNING absamad openerp.pooler: openerp.pooler.get_db_and_pool() is deprecated.
2016-05-29 23:04:16,417 1981 INFO absamad financial.reports.webkit: DEBUG ALEXIS command=['/usr/local/bin/wkhtmltopdf', '--quiet', '--encoding', 'utf-8', '--margin-top', '17.0', '--margin-bottom', '15.0', '--orientation', 'Portrait', '--page-size', 'A4', '--header-font-name', 'Helvetica', '--footer-font-name', 'Helvetica', '--header-font-size', '10', '--footer-font-size', '6', '--header-left', u'BALANCE DES COMPTES - Monast\xe8re Sainte-Madeleine - EUR', '--header-spacing', '2', '--footer-left', '30/05/2016 01:02:24', '--footer-right', u'Page [page] de [topage]', '--footer-line', '/tmp/tmpRth7M90.body.html', '/tmp/webkit.tmp.QPX1Ic.pdf']
2016-05-29 23:04:16,451 1981 ERROR absamad openerp.service.report: Exception: execv() arg 2 must contain only strings
Traceback (most recent call last):
File "/home/openerp/erp/odoo/openerp/service/report.py", line 93, in go
result, format = openerp.report.render_report(cr, uid, ids, object, datas, context)
File "/home/openerp/erp/odoo/openerp/report/__init__.py", line 40, in render_report
return registry['ir.actions.report.xml'].render_report(cr, uid, ids, name, data, context)
File "/home/openerp/erp/odoo/openerp/api.py", line 256, in wrapper
return old_api(self, *args, **kwargs)
File "/home/openerp/erp/odoo/openerp/addons/base/ir/ir_actions.py", line 156, in render_report
return new_report.create(cr, uid, res_ids, data, context)
File "/home/openerp/erp/odoo/addons/report_webkit/webkit_report.py", line 377, in create
result = self.create_source_pdf(cursor, uid, ids, data, report_xml, context)
File "/home/openerp/erp/odoo/openerp/report/report_sxw.py", line 464, in create_source_pdf
return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
File "/home/openerp/erp/account-financial-reporting/account_financial_report_webkit/report/webkit_parser_header_fix.py", line 279, in create_single_pdf
parser_instance=parser_instance)
File "/home/openerp/erp/account-financial-reporting/account_financial_report_webkit/report/webkit_parser_header_fix.py", line 155, in generate_pdf
status = subprocess.call(command, stderr=stderr_fd)
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
TypeError: execv() arg 2 must contain only strings
2016-05-29 23:04:16,719 1981 ERROR absamad openerp.addons.web.controllers.main: An exception occured during an http request
Traceback (most recent call last):
File "/home/openerp/erp/odoo/addons/web/controllers/main.py", line 70, in wrap
return f(*args, **kwargs)
File "/home/openerp/erp/odoo/addons/web/controllers/main.py", line 1586, in index
request.session.db, request.session.uid, request.session.password, report_id)
File "/home/openerp/erp/odoo/openerp/http.py", line 879, in proxy_method
result = dispatch_rpc(self.service_name, method, args)
File "/home/openerp/erp/odoo/openerp/http.py", line 115, in dispatch_rpc
result = dispatch(method, params)
File "/home/openerp/erp/odoo/openerp/service/report.py", line 34, in dispatch
res = fn(db, uid, *params)
File "/home/openerp/erp/report-print-send/base_report_to_printer/report_service.py", line 86, in exp_report_get
return original_exp_report_get(db, uid, report_id)
File "/home/openerp/erp/odoo/openerp/service/report.py", line 141, in exp_report_get
return _check_report(report_id)
File "/home/openerp/erp/odoo/openerp/service/report.py", line 119, in _check_report
raise openerp.osv.orm.except_orm(exc.message, exc.traceback)
except_orm: (u'execv() arg 2 must contain only strings', (<type 'exceptions.TypeError'>, TypeError('execv() arg 2 must contain only strings',), <traceback object at 0x7f7678dcce60>))
2016-05-29 23:04:16,749 1981 INFO absamad werkzeug: 192.168.10.201 - - [29/May/2016 23:04:16] "POST /web/report HTTP/1.0" 500 -
2016-05-29 23:04:16,953 1980 INFO ? werkzeug: 192.168.10.201 - - [29/May/2016 23:04:16] "GET /web/static/src/img/warning.png HTTP/1.0" 304 -
The option --header-left comes from the key additional_args in self.localcontext. It is set by account_financial_report_webkit/report/trial_balance.py line 63.
I don't know what is the real solution to this problem. I first tried a patch to encode in utf8 the elements of the "command" variable ; it avoids the crash, but the accentuated caracters are absent from the header. My second patch uses unidecode to replace the accentuated char by the equivalent regular char ; it is certainly not the right solution to this issue, but at least it works.