[PSYCOPG2] Error use result in cr.fetchall() with accent

Bug #307908 reported by Christophe CHAUVET
2
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Christophe Simonis (OpenERP)

Bug Description

Hi

When execute a query with cr.execute() and retrieve the result with cr.fetchall(), the result which containt accent raise an error

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(12)

to works i must encode in utf-8 like
----------8<----------------8<-----------
 result = cr.fetchall()
for x in result.encode('UTF-8')
----------8<----------------8<-----------

This problem appear with psycopg2, use french langage with accent (éèàïêî ...)

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

Seems not related to Tiny.
Accents works well in Open ERP.
I close the bug, if you have a bug related to this in Open eRP, please explain where.

Changed in openobject-server:
status: New → Invalid
Revision history for this message
Sebastien LANGE - http://www.Syleam.fr (alnslang) wrote :

No, we have this issue with OpenERP.
Create a new database in French with minimal profile and install the crm_profiling module and create question with accent (éùà) and try to use this question in partner form.

I think that issue is not just in this module.

Changed in openobject-server:
status: Invalid → New
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote : Re: [Bug 307908] Re: [PSYCOPG2] Error use result in cr.fetchall() with accent

Christophe, I think you should:
* Keep the unicode format instead of UTF8
* grep str(.*) in all addons and addons-extra

For the rest, we have to test a lot. But I think it's better to go for
unicode instead of UTF8.

Sebastien LANGE - http://www.Syleam.fr wrote:
> No, we have this issue with OpenERP.
> Create a new database in French with minimal profile and install the crm_profiling module and create question with accent (éùà) and try to use this question in partner form.
>
> I think that issue is not just in this module.
>
>
> ** Changed in: openobject-server
> Status: Invalid => New
>

--
Fabien Pinckaers
CEO Tiny - OpenERP Editor
Chaussée de Namur 40
B-1367 Grand-Rosière
Belgium
Phone: +32.81.81.37.00
Fax: +32.81.73.35.01
Web: http://openerp.com

Great Achievements Start With Tiny Investments
   -- Marty, 2005

Changed in openobject-server:
assignee: nobody → christophe-simonis
Changed in openobject-server:
status: New → 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.