libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clemens Wolff (JIRA)" <>
Subject [jira] [Created] (LIBCLOUD-1043) Azure Storage driver crashes when passed a non file-like iterator
Date Fri, 17 May 2019 18:05:00 GMT
Clemens Wolff created LIBCLOUD-1043:

             Summary: Azure Storage driver crashes when passed a non file-like iterator
                 Key: LIBCLOUD-1043
             Project: Libcloud
          Issue Type: Bug
            Reporter: Clemens Wolff

The azure_blobs implementation of {{upload_object_via_stream(iterator, ...)}} currently assumes
that the passed-in iterator always is a file-like object that implements {{seek(...)}} ([source|]).

This means that function crashes when used with arbitrary iterators as returned by {{iter(...)}}.

Notably, the libcloud integration for django-storages exercises this functionality ([source|])
which makes django-storages + libcloud + Azure Blobs currently unusable. See detailed stacktrace

Traceback (most recent call last):
  File ".../app/", line 15, in <module>
  File "...\lib\site-packages\django\core\management\", line 381, in execute_from_command_line
  File "...\lib\site-packages\django\core\management\", line 375, in execute
  File "...\lib\site-packages\django\core\management\", line 316, in run_from_argv
    self.execute(*args, **cmd_options)
  File "...\lib\site-packages\django\core\management\", line 353, in execute
    output = self.handle(*args, **options)
  File "...\lib\site-packages\django\contrib\staticfiles\management\commands\",
line 188, in handle
    collected = self.collect()
  File "...\lib\site-packages\django\contrib\staticfiles\management\commands\",
line 114, in collect
    handler(path, prefixed_path, storage)
  File "...\lib\site-packages\django\contrib\staticfiles\management\commands\",
line 353, in copy_file, source_file)
  File "...\lib\site-packages\django\core\files\", line 49, in save
    return self._save(name, content)
  File "...\lib\site-packages\storages\backends\", line 157, in _save
    self.driver.upload_object_via_stream(iter(file), self._get_bucket(), name)
  File "...\lib\site-packages\libcloud\storage\drivers\", line 828, in upload_object_via_stream, os.SEEK_END)
AttributeError: 'generator' object has no attribute 'seek'

This message was sent by Atlassian JIRA

View raw message