Error storing jobs with unicode arguments

Bug #1288187 reported by Stéphane Bidoul (Acsone)
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenERP Connector
Fix Released
Undecided
Unassigned

Bug Description

Hello,

Jobs with unicode arguments cannot be stored.

This is because the framework attemps to store pickles in a string column and postgres attempts to do a unicode conversion.

I attach a MP with a test that reproduces the error and a proposed fix.

The drawback of this fix is that it is not backward compatible with existing stored jobs.

-sbi

Related branches

Revision history for this message
Jörg Frings-Fürst (jff-de) wrote :

Hi Stéphane,

we need some more information. From a terminal window please run:

sudo apport-collect 1288187

and then change the status of the bug to 'Confirmed'.

Jörg

Changed in openerp-connector:
status: New → Incomplete
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

sudo apport-collect 1288187 does not do anything -> No additional information collected.

I should say I don't think it will add any useful information for an openerp connector issue.

What may be relevant is that I have a Posgresql 9.1.12 database with UTF-8 encoding.

Changed in openerp-connector:
status: Incomplete → Confirmed
Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hi Guewen,

I attach the test log which shows the error.

It looks like a problem with postgres trying to utf-8 encode the pickle byte sequence.
DataError: invalid byte sequence for encoding "UTF8": 0xe90a70

-sbi

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Same version of postgresql with UTF-8 encoding too.
The error is not produced when I run the same test.
Thanks for the log, I will compare the query to mine.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Here is the excerpt of the postgresql log when I run the same test.
The pickle seems correct here.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Do you have any idea why it behaves differently?

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

No, that's ok, my test was not identical, I could reproduce it.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

The error here is that pickled data are binary data. Psycopg2 tries to decode data to UTF-8 which is not possible because this is not UTF-8 data but binary data.

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