libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Quentin Pradet (JIRA)" <>
Subject [jira] [Created] (LIBCLOUD-916) s3.upload_object_via_stream no longer accepts unicode
Date Thu, 04 May 2017 06:42:04 GMT
Quentin Pradet created LIBCLOUD-916:

             Summary: s3.upload_object_via_stream no longer accepts unicode
                 Key: LIBCLOUD-916
             Project: Libcloud
          Issue Type: Bug
            Reporter: Quentin Pradet

Consider this snippet:

import io
from import Container
from import GoogleStorageDriver

driver = GoogleStorageDriver(key='replaceme', secret='replaceme')
container = Container(name='container', driver=driver, extra={})
driver.upload_object_via_stream(io.StringIO(' '), container, 'path')

In libcloud 1.5, upload_object_via_stream was calling libcloud.utils.files.read_in_chunks
who encodes the data in UTF-8. In libcloud 2.0, the unicode data is directly sent to requests
which requires a bytes body when sent in chunks.

Should we work around the issue in libcloud or decide that bytes are required in the iterator?

This message was sent by Atlassian JIRA

View raw message