You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if it is by design, but I strongly feel that the example code given for uploading a file in the README is misguiding https://github.com/minio/minio-py#file-uploaderpy . This is because, according to this snippet, the file shall be uploaded only if the bucket does not exist, otherwise, if it exists, the code in the else block will never be executed.
from minio import Minio
from minio.error import (ResponseError, BucketAlreadyOwnedByYou,
BucketAlreadyExists)
# Initialize minioClient with an endpoint and access/secret keys.
minioClient = Minio('play.min.io',
access_key='Q3AM3UQ867SPQQA43P2F',
secret_key='zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG',
secure=True)
# Make a bucket with the make_bucket API call.
try:
minioClient.make_bucket("maylogs", location="us-east-1")
except BucketAlreadyOwnedByYou as err:
pass
except BucketAlreadyExists as err:
pass
except ResponseError as err:
raise
else:
# Put an object 'pumaserver_debug.log' with contents from 'pumaserver_debug.log'.
try:
minioClient.fput_object('maylogs', 'pumaserver_debug.log', '/tmp/pumaserver_debug.log')
except ResponseError as err:
print(err)
I can take this up and make the change.
The text was updated successfully, but these errors were encountered:
urandu
added a commit
to urandu/minio-py
that referenced
this issue
Oct 12, 2019
I am not sure if it is by design, but I strongly feel that the example code given for uploading a file in the README is misguiding https://github.com/minio/minio-py#file-uploaderpy . This is because, according to this snippet, the file shall be uploaded only if the bucket does not exist, otherwise, if it exists, the code in the else block will never be executed.
I can take this up and make the change.
The text was updated successfully, but these errors were encountered: