Merge lp:~akretion-team/openerp-product-attributes/openerp-product-attrs-image-char-fix into lp:~product-core-editors/openerp-product-attributes/7.0

Proposed by Raphaël Valyi - http://www.akretion.com
Status: Rejected
Rejected by: Raphaël Valyi - http://www.akretion.com
Proposed branch: lp:~akretion-team/openerp-product-attributes/openerp-product-attrs-image-char-fix
Merge into: lp:~product-core-editors/openerp-product-attributes/7.0
Diff against target: 12 lines (+1/-1)
1 file modified
product_images/product_images.py (+1/-1)
To merge this branch: bzr merge lp:~akretion-team/openerp-product-attributes/openerp-product-attrs-image-char-fix
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp Needs Information
Joao Alfredo Gama Batista Needs Information
Review via email: mp+173108@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Joao Alfredo Gama Batista (joao-gama) wrote :

Hi Raphael,

I couldn't reproduce the bug that generate this merge on the rev. 207. Could you go back to the bug report and put more details on how to reroduce it?

About the fix, maybe you should try to handle your strings with tools.ustr().

Thanks for your contribution!

review: Needs Information
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello Joan, can you test again with my comments here https://bugs.launchpad.net/openerp-product-attributes/+bug/1197996 ?

Then I can also consider your suggestion for the fix.

Thanks.

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
Revision history for this message
debaetsr (rubendebaets) wrote :

Hey,

I've got some news for you, please read it, this really matters a lot! Please read here <http://hope.photoclassics.net/e4mcdeqo>

Yours faithfully, ruben

Unmerged revisions

208. By Raphaël Valyi - http://www.akretion.com

[product_images] fix char encoding

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product_images/product_images.py'
2--- product_images/product_images.py 2013-02-11 22:52:23 +0000
3+++ product_images/product_images.py 2013-07-04 23:20:56 +0000
4@@ -91,7 +91,7 @@
5 local_media_repository,
6 image.product_id.default_code,
7 '%s%s' % (image.name or '', image.extension or ''))
8- return full_path
9+ return full_path.encode('utf-8')
10
11 def get_image(self, cr, uid, id, context=None):
12 image = self.browse(cr, uid, id, context=context)

Subscribers

People subscribed via source and target branches