Files
odoo_source/addons/base_import/models
Saurabh Choraria 5156b22072 [FIX] base_import: prevent traceback if image data contains non ASCII characters
When user tries to add non ascii characters in image field column in a file and
then when he tries to import it the error will occur.

Steps to reproduce:
1. Install contacts
2. export a contact and keep image field in fields to export.
3. Now in that file change the image data and add non ASCII characters
(for example: 'ô').
4. Now try to import this file in contacts.
5. The error will occur.

Applying this commit will fix this issue.

Currently, a ValueError is raised when we give non-ascii characters as input.
So I have reported an issue in python in which I have mentioned to edit the
documentation to note that it may raise ValueError for non-ascii content, or
to fix '_bytes_from_decode_data' function to raise binascii.Error instead of
ValueError.

To track the issue - https://github.com/python/cpython/issues/105193

sentry-4029823200

closes odoo/odoo#123572

X-original-commit: ceb67160e1747f0a886efb8ca0a60499e2b080d1
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-06-05 11:49:50 +02:00
..