[report] (trunk) reports cannot be printed if name contains non latin charachter

Bug #1072803 reported by Giedrius Slavinskas - inovera.lt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Web Team

Bug Description

It is not possible to print any report, if report name contains non latin-1 character.

How to reproduce:
1. Switch user interface to some non-latin language.
2. Find a report with non-latin character in name.
3. Print it.

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/werkzeug/serving.py", line 159, in run_wsgi
    execute(app)
  File "/usr/lib/python2.7/site-packages/werkzeug/serving.py", line 146, in execute
    application_iter = app(environ, start_response)
  File "/home/giedrius/Projektai/inovera/lib/openerp-server-7/openerp/service/wsgi_server.py", line 408, in application
    return application_unproxied(environ, start_response)
  File "/home/giedrius/Projektai/inovera/lib/openerp-server-7/openerp/service/wsgi_server.py", line 393, in application_unproxied
    result = handler(environ, start_response)
  File "/home/giedrius/Projektai/inovera/lib/openerp-web-7-old/addons/web/http.py", line 461, in __call__
    return self.dispatch(environ, start_response)
  File "/home/giedrius/Projektai/inovera/lib/openerp-web-7-old/addons/web/http.py", line 435, in __call__
    return self.app(environ, start_wrapped)
  File "/usr/lib/python2.7/site-packages/werkzeug/wsgi.py", line 411, in __call__
    return self.app(environ, start_response)
  File "/home/giedrius/Projektai/inovera/lib/openerp-web-7-old/addons/web/http.py", line 491, in dispatch
    return response(environ, start_response)
  File "/usr/lib/python2.7/site-packages/werkzeug/wrappers.py", line 1082, in __call__
    app_iter, status, headers = self.get_wsgi_response(environ)
  File "/usr/lib/python2.7/site-packages/werkzeug/wrappers.py", line 1072, in get_wsgi_response
    return app_iter, self.status, headers.to_list()
  File "/usr/lib/python2.7/site-packages/werkzeug/datastructures.py", line 1141, in to_list
    for k, v in self]
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u0105' in position 23: ordinal not in range(256)

openobject-server revno: 4516
openobject-addons revno: 7886
openerp-web revno: 3328

Related branches

affects: openobject-server → openerp-web
Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Giedrius,

I have checked your Issue with latest trunk,
(Build 23654)
server : 4520
addons : 7898
web : 3331.

I did not faced any error while print report with non-latin character. but I have faced the another problem in generated report. So would you please check it again with latest revision and notify us where you have faced the problem.

Thanks and waiting for your reply!

Changed in openerp-web:
status: New → Incomplete
Revision history for this message
Giedrius Slavinskas - inovera.lt (gdrius) wrote :

Hi Amit,

The error still remains. Please, check my merge request https://code.launchpad.net/~gdrius/openerp-web/trunk-bugfix-1072803-giedrius/+merge/132085

You can clearly see from my patch that the returned report filename was not properly escaped in the http response header.

Here is more detail steps how to reproduce this behaviour:
1. Add some non latin characters to translation of report name (any of these ąžšėųįčū)
2. Print this report (you must see these nonlatin characters in the action name)

Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Giedrius,

I have checked your scenario as per your comment. Still I did not faced the error. I also check the code of "addons/web/controllers/main.py". It's already Improve in latest revision. That's why I am set this Issue as Fix-Released.

Moreover, I have attached the video for your reference. would you please check It.

Thanks for the reporting!

Changed in openerp-web:
status: Incomplete → Fix Released
Revision history for this message
Giedrius Slavinskas - inovera.lt (gdrius) wrote :

Hi Amit,

I've rechecked it again with the latest revision of web and server. The bug still remains. Check out my video.

It could be that the reason it works for you, is the version of werkzeug library. Maybe in some versions it works, in other not, but the general approach how the Content-Disposition header is set in addons/web/controllers/main.py (revision 3336) is wrong.
You can check this RFC, Appendix D http://tools.ietf.org/html/rfc6266#appendix-D

Also, please, check my merge proposal. It is already approved by your teammate.

Changed in openerp-web:
status: Fix Released → New
Revision history for this message
Amit Bhavsar (Open ERP) (amb-openerp) wrote :

Hello Giedrius,

Yes I agree with you that, It's work at my end due to the version of werkzeug library. might be possible that It's generate at your side due to some locales.

So It's not generalise bug, But we should Improve this behaviour. That's why I am confirm this Issue with medium Importance.

Thanks for reporting!

Changed in openerp-web:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Web Team (openerp-dev-web)
Changed in openerp-web:
status: Confirmed → Fix Committed
summary: - [trunk] reports cannot be printed if name contains non latin charachter
+ [report] (trunk) reports cannot be printed if name contains non latin
+ charachter
Revision history for this message
Nicolas Vanhoren (OpenERP) (niv-openerp) wrote :

I tested a report with characters 漢字 in its name and that worked. I assume it is fixed.

Changed in openerp-web:
status: Fix Committed → Fix Released
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.