minio / minio-py

MinIO Client SDK for Python
https://docs.min.io/docs/python-client-quickstart-guide.html
Apache License 2.0
822 stars 318 forks source link

Conservative fix for issue #1396 #1397

Closed renaudcalmont closed 7 months ago

renaudcalmont commented 7 months ago

Inspired by the attempted fix and the discussion on PR #1240

renaudcalmont commented 7 months ago

Here is the XML:

<?xml version="1.0" encoding="UTF-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <Name>my-bucket</Name>
    <Prefix>folder1/</Prefix>
    <KeyCount>1</KeyCount>
    <MaxKeys>1000</MaxKeys>
    <Delimiter></Delimiter>
    <IsTruncated>false</IsTruncated>
    <Contents>
        <Key>folder1/demo.png</Key>
        <LastModified>2024-02-05T08:38:08.701Z</LastModified>
        <ETag>&#34;ac3f317acfca55f3df5faae3893caae9&#34;</ETag>
        <Size>245179</Size>
        <Owner>
            <ID>026078f086f1b6cd6176db174dc93c54445fe8cb1b899f7ce98d8855f66bdbf4</ID>
            <DisplayName>minio</DisplayName>
        </Owner>
        <StorageClass>STANDARD</StorageClass>
        <UserMetadata>
            <Items>
                <Key>X-Amz-Meta-My-Attribute1</Key>
                <Value>Hello</Value>
            </Items>
            <Items>
                <Key>content-type</Key>
                <Value>image/png</Value>
            </Items>
            <Items>
                <Key>X-Amz-Meta-My-Attribute2</Key>
                <Value>World</Value>
            </Items>
        </UserMetadata>
    </Contents>
    <EncodingType>url</EncodingType>
</ListBucketResult>
balamurugana commented 7 months ago

I do not get this XML for bucket mybucket from play.min.io. Below is an XML snippet from the server

  <Contents>
    <Key>zero</Key>
    <LastModified>2024-02-06T10:45:03.076Z</LastModified>
    <ETag>"ae33d6face3d0a8882059e2583725b78"</ETag>
    <Size>5</Size>
    <StorageClass>STANDARD</StorageClass>
    <UserMetadata>
      <X-Amz-Server-Side-Encryption>AES256</X-Amz-Server-Side-Encryption>
      <X-Amz-Meta-Key2>value2</X-Amz-Meta-Key2>
      <content-type>application/octet-stream</content-type>
      <X-Amz-Meta-Key1>value1</X-Amz-Meta-Key1>
      <expires>Mon, 01 Jan 0001 00:00:00 GMT</expires>
    </UserMetadata>
    <Internal>
      <K>2</K>
      <M>2</M>
    </Internal>
  </Contents>

You would need to upgrade your MinIO server.

renaudcalmont commented 7 months ago

Okay... what about retro-compatibility? I'm in a corporate environment where I can't check the exact release and I surely don't have the freedom to upgrade the server. Anyway I believe it's not that old, around one year behind but I didn't see any previous tag where the functionality is working with the syntax.

balamurugana commented 7 months ago

You could use minio-py v7.1.14

If you are looking for paid support, refer https://min.io/pricing

renaudcalmont commented 7 months ago

Indeed :) I don't know how I tricked myself with the code browser to miss it! Thanks