Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. # uploading a gzip'd tar file with the sdk works but is awkward:
  2. obj = conn.object_store.create_object(CONTAINER_NAME, tar_file_name)
  3. obj.data = open(tar_file_location, 'rb')
  4. obj.create(conn.object_store)
  5.  
  6. # same with shade breaks with unicode decoding error as file isn't being opened as binary:
  7. obj = conn.create_object(CONTAINER_NAME, tar_file_location)
  8.  
  9. # would expect something like the following to work:
  10. obj = conn.object_store.create_object(CONTAINER_NAME, tar_file_name, data=open(tar_file_location, 'rb'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement