You are not using the length param in Minio.put_object, why not make it optional?
See original GitHub issueSee: https://github.com/minio/minio-py/blob/master/minio/api.py#L797
def put_object(self, bucket_name, object_name, data, length,
content_type='application/octet-stream',
metadata=None):
# ...
return self._do_put_object(bucket_name, object_name,
current_data, len(current_data),
metadata=metadata)
And getting the length of when doing put_object is tedious and make no much sense.
For example:
buf = io.BytesIO(b'Hello, World!')
length = buf.getbuffer().nbytes
ossc.put_object('default', 'test-blob', buf, length)
Which makes too much noise to my code, I probably should care whether the buf
object is an BytesIO or other file-like object.
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Python Client API Reference — MinIO Object Storage for Linux
(Optional) Credentials provider of your account in S3 service. NOTE on concurrent usage: Minio object is thread safe when using the Python threading...
Read more >PutObject - Amazon Simple Storage Service
With server-side encryption, Amazon S3 encrypts your data as it writes it to disks in its data centers and decrypts the data when...
Read more >Is it possible to save a group of files with MinIO client in one ...
You can try use this S3 feature, MinIO also support this feature. Create .tar or .zip archive and send to S3 with metadata...
Read more >AWS S3 with Java - Reactive Support - Baeldung
By using a reactive stack, we can make our service much less ... we need the part's length, but chunked file transfers do...
Read more >S3Fs — S3Fs 2022.11.0+4.g5917684 documentation
s3.read_block(path, offset=1000, length=10, delimiter=b'\n') b'A whole line ... If you are not using async-style programming, you do not need to know about ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@gerritsangel The support is added in the master https://github.com/minio/minio-py/blob/master/minio/api.py#L1252
We will make new release soon.
Hello,
I was wondering on how to upload a stream of unknown size with the Minio Python SDK.
The Java SDK supports uploading of unknown size streams, so I’m a bit surprised that the Python SDK doesn’t seem to support it.
(See https://minio-java.min.io/io/minio/MinioClient.html#putObject-io.minio.PutObjectArgs-):
Here, the file part size must be manually specified, but the stream length can be set as -1.
is there any protocol issue that would prevent the Python SDK to support unknown streams? Reading the entire stream into memory is difficult if it is a large file, especially on devices with few memory 😦