cloudinary / pycloudinary

Python package for cloudinary
https://cloudinary.com/documentation/django_integration
Other
256 stars 138 forks source link

Regression in Cloudinary 1.26.0 "ValueError: embedded null byte" when using `upload_resource` #293

Closed levinotik closed 3 years ago

levinotik commented 3 years ago

Bug report for Cloudinary Python SDK

Before proceeding, please update to the latest version and test if the issue persists

Describe the bug in a sentence or two.

New regression in version 1.26.0. Using cloudinary.uploader.upload_resource results in

file_io = open(file, 'rb')
ValueError: embedded null byte

Same code works fine when reverting to cloudinary 1.25.0 …

Issue Type (Can be multiple)

Steps to reproduce

Retrieve bytes of an image and then pass to cloudinary.uploader.upload_resource. Results in

Traceback (most recent call last):
  File "/Users/levinotik/dev/gj/control/control/turns/tasks/sync_photos_from_foto_notes.py", line 58, in set_cloudinary_image
    photo.image = cloudinary.uploader.upload_resource(response)
  File "/Users/levinotik/dev/gj/control/.venv/lib/python3.8/site-packages/cloudinary/uploader.py", line 61, in upload_resource
    result = upload_large(file, **options)
  File "/Users/levinotik/dev/gj/control/.venv/lib/python3.8/site-packages/cloudinary/uploader.py", line 76, in upload_large
    file_io = open(file, 'rb')
ValueError: embedded null byte

Error screenshots or Stack Trace (if applicable)

Operating System

Environment and Frameworks (fill in the version numbers)

Repository

If possible, please provide a link to a reproducible repository that showcases the problem

levinotik commented 3 years ago

Note that upload_resource now uses upload_large instead of upload internally which may be the source of the issues.

image

momoip commented 3 years ago

Hi levinotik, Thanks for reaching out. I'm checking with our Dev team right now. I will keep you posted. Mo

momoip commented 3 years ago

Hi levinotik, Thanks for your patience. We've confirmed it's a bug and I've raised an internal ticket with high priority to fix it. I will keep you posted when it's fixed. Thanks, Mo

levinotik commented 3 years ago

Any movement on this? Would be great to upgrade our dependency. As of now we cannot use cloudinary > 1.25.0

momoip commented 3 years ago

I'm checking internally and will update you the status once I get some insights.

const-cloudinary commented 3 years ago

Hi @levinotik , the issue should be fixed in: https://github.com/cloudinary/pycloudinary/releases/tag/1.28.0

levinotik commented 3 years ago

Fantastic, thanks a lot!