Code review comment for lp:~akretion-team/openerp-product-attributes/openerp-product-attrs-image-char-fix

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

I don't think that openerp.tools.ustr() and unicode().encode() serve the same purpose.

openerp.tools.ustr() takes a byte string and try to convert it to unicode (with an optional default encoding or try to guess). It uses the unicode() constructor.

While unicode().encode() used in the Raphaël's code convert an unicode string to a byte string with the requested encoding.

However, I don't see why you would need the byte string here. It seems to me that open() accepts the unicode string (is it related to the filesystem?)

review: Needs Information

« Back to merge proposal