-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
content_type isn't returned by list_objects so examples/list_objects.py incorrectly shows it doing so #1284
Comments
This is normal list objects do not respond back with content type, we should update the examples and remove it from them. |
You would need to read API documentation and respective S3 specification. |
You closed this but I don't see the example I listed as incorrect fixed. So are you fixing the example? |
There is no issue in the example. ListObjects S3 APIs do not return |
The code in examples/list_objects.py starting at line 27 is as follows:
So the example is calling list_objects, iterating through the returned objects and printing obj.content_type which is always None. The simple fix would be at least to remove the printing of that field so the reader wouldn't think they should be able to. |
Feel free to send a PR |
I see that it's already fixed in the master branch three years ago but still incorrect in the release branch, so no PR is needed, but can't you get the release branch merged from master so people installing this library with pip will see the correction? |
|
I'm seeing that pip install minio did NOT pull the master branch it pulled the release branch. Can you think of why this would be so? I changed my requirements.txt from: and that seems to have gotten the master branch, but that's not what people would normally know to do. the only output is going to be like: which seems less useful than the same example in the release branch with the exception that the release branch makes it appear that content_type is available when it is not. |
Also, the documentation page at https://min.io/docs/minio/linux/developers/python/minio-py.html in the More References section links to the release (not the master) branch of the corresponding pages which is how I found the examples/list_objects.py file in the first place. So if you are saying that the release branch should no longer be used you should at least point to master instead of release on your docs page. |
If you look at https://pypi.org/project/minio/#history you will see that the version of minio that pypi is pointing to is the release version and not master, so I believe anyone using 'pip install minio' is not going to get the version you recommend. |
@sprior I think you are just confused https://github.com/minio/minio-py/blob/7.1.15/examples/list_objects.py |
Every single comment here is wrong here @sprior |
Go to the link in my last comment: https://min.io/docs/minio/linux/developers/python/minio-py.html |
Feel free to send a fix, happy to accept a PR. |
Can you recommend where to change this? It seems that the main minio docs page is still pointing to your release branch instead of master. As I pointed out above if you start at the minio docs page at https://min.io/docs/minio/kubernetes/upstream/ then click on SDKs under Developers, then scroll to Python and click on MinIO Python SDK Reference then scroll to the bottom, the Examples link there points to the obsolete release branch instead of the master branch. This is how I got confused because it shows content_type. I traced it to this file: But that doesn't show which branch it links to so I don't know how to change that for a PR. |
I created #1285 |
So now that it's merged into master, how long before the correction is live on the docs website? |
FYI, I just figured out where I was confused above - your releases aren't from the release branch, they're tags from the master branch. So if you clone master you see the code is version 7.1.16 when the released version you get from pip install minio is version 7.1.15 and naturally assume this is from the release branch, but it's not. |
If i try to use list_object i only get a memory reference of the object and nothing helpful. It prints like
I would like to list folders and files in a bucket with the minio API in Python.
Seems i need to use boto3 instead. // checked the class object in code and found the relevant parts
So i need to use |
Line 31 of examples/list_objects.py shows content_type being printed for objects returned by list_objects, but apparently content_type isn't filled in by that call so the example is misleading - it always prints None.
The text was updated successfully, but these errors were encountered: