Skip to Content
Menu
This question has been flagged

I'm trying to do import data into odoo (running inside a container) with image url. some of them is webp and whenever odoo try to import those webp it got error :

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/var/lib/odoo/.local/lib/python3.10/site-packages/PIL/Image.py", line 3572, in open
    raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x75889b2817b0>

Tried this simple code (like the one used by odoo for importing image with url) :

  • In container python interpreter, it works without error
  • In odoo debugging console, got the error
import io
from PIL import Image
import requests
res = requests.get('https://www.gstatic.com/webp/gallery/1.webp')
content = bytearray()
for chunk in res.iter_content(32768): content += chunk
image = Image.open(io.BytesIO(content))


Odoo tag  :  17.0-20250520

Avatar
Discard
Author Best Answer

Have already tried those. and still same issue.

in debugger attached to container (using debugpy) got error :

In same container but directly in shell (No error) :


It's like if something in odoo is causing the error.

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 25
116
2
Mar 25
934
1
Feb 25
1098
1
Dec 24
1644
0
Dec 24
1394