[6.1] TypeError: coercing to Unicode

Bug #974977 reported by Ilya
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

When i'm clicking on "Stock Level Forecast" in products comes out an error

Client Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-6.1_1-py2.6.egg/openerp/addons/web/common/http.py", line 260, in dispatch
    r = method(controller, self, **self.params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-6.1_1-py2.6.egg/openerp/addons/web/controllers/main.py", line 1784, in index
    req.session._db, req.session._uid, req.session._password, report_id)
  File "/usr/local/lib/python2.6/dist-packages/openerp-6.1_1-py2.6.egg/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/usr/local/lib/python2.6/dist-packages/openerp-6.1_1-py2.6.egg/openerp/addons/web/common/http.py", line 596, in send
    fault = xmlrpclib.Fault('warning -- ' + e.name + '\n\n' + e.value, '')
TypeError: coercing to Unicode: need string or buffer, tuple found

This error is only when the name of product on russian language. when name in english it works normal. Please help

Amit Parik (amit-parik)
affects: openobject-client-web → openerp-web
Amit Parik (amit-parik)
affects: openerp-web → openerp-server
affects: openerp-server → openobject-server
Revision history for this message
Jigar A. (ifixthat) wrote :
Download full text (4.0 KiB)

Hello
Their is no connection between lp:956798and this bug.
Here Stock Graph report is generate using PyChart which is Independent to Server Report Engine.
Being more specific the trackback looks like this :
2012-08-29 06:05:34,223 5050 ERROR ? openerp.service.web_services: Exception: 'charmap' codec can't encode characters in position 0-7: character maps to <undefined>
Traceback (most recent call last):
  File "/home/openerp/source/server/trunk/openerp/service/web_services.py", line 726, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/home/openerp/source/addons/trunk/stock/report/product_stock.py", line 108, in create
    gt.draw()
  File "/home/openerp/source/addons/trunk/stock/report/stock_graph.py", line 101, in draw
    ar.draw(self._canvas)
  File "/usr/lib/pymodules/python2.7/pychart/area.py", line 248, in draw
    self.legend.draw(self, legends, can)
  File "/usr/lib/pymodules/python2.7/pychart/legend.py", line 178, in draw
    l.draw(ar, can, this_x, this_x + max_sample_width[col], this_y)
  File "/usr/lib/pymodules/python2.7/pychart/legend.py", line 88, in draw
    can.show(x_label, y, self.label)
  File "/usr/lib/pymodules/python2.7/pychart/basecanvas.py", line 503, in show
    self.text_show(font_name, nscale(size), color, str)
  File "/usr/lib/pymodules/python2.7/pychart/pdfcanvas.py", line 171, in text_show
    self.__write("(%s) Tj " % (str.encode('mac_roman')))
  File "/usr/lib/python2.7/encodings/mac_roman.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-7: character maps to <undefined>
2012-08-29 06:05:34,436 5050 ERROR None openerp.netsvc: charmap
Анатолий أناتولي 阿纳托利 アナトーリー 아나톨리 अनातोली อานาโตลี آناتولی
0
8
character maps to <undefined>
(<type 'exceptions.UnicodeEncodeError'>, UnicodeEncodeError('charmap', u'\u0410\u043d\u0430\u0442\u043e\u043b\u0438\u0439 \u0623\u0646\u0627\u062a\u0648\u0644\u064a \u963f\u7eb3\u6258\u5229 \u30a2\u30ca\u30c8\u30fc\u30ea\u30fc \uc544\ub098\ud1a8\ub9ac \u0905\u0928\u093e\u0924\u094b\u0932\u0940 \u0e2d\u0e32\u0e19\u0e32\u0e42\u0e15\u0e25\u0e35 \u0622\u0646\u0627\u062a\u0648\u0644\u06cc', 0, 8, 'character maps to <undefined>'), <traceback object at 0xb4d9e64>)
Traceback (most recent call last):
  File "/home/openerp/source/server/trunk/openerp/netsvc.py", line 362, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/openerp/source/server/trunk/openerp/service/web_services.py", line 669, in dispatch
    res = fn(db, uid, *params)
  File "/home/openerp/source/server/trunk/openerp/service/web_services.py", line 774, in exp_report_get
    return self._check_report(report_id)
  File "/home/openerp/source/server/trunk/openerp/service/web_services.py", line 752, in _check_report
    netsvc.abort_response(exc, exc.message, 'warning', exc.traceback)
  File "/home/openerp/source/server/trunk/openerp/netsvc.py", line 67, in abort_response
    raise openerp.osv.osv.except_osv(description, details)
except_osv: (u'charmap\n\u0410\u043d\u0430\u0442\u043e\u043b\u0438\u0439 \u0623\u0646\u0627\u062a\u0648\u0644\u...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.