Python3 incompability in signer.py
See original GitHub issueJust did a pip3 install minio and got minio (2.0.2)
I see problems with put_object on Python3 (3.5.2).
Example code:
from minio import Minio
from minio.error import ResponseError
minioClient = Minio('127.0.0.1:9000',
access_key='xxx',
secret_key='xxx',
secure=True)
try:
minioClient.fput_object('mybucket', 'myobject.ogg', 'my-testfile')
except ResponseError as err:
print(err)
I used the sample code from website, even though it has wrong endpoint and keys for my setup. Point is, it boils out earlier:
#> echo “test” > my-testfile
#> python3 test.py
Traceback (most recent call last):
File “test.py”, line 15, in <module>
minioClient.fput_object(‘mybucket’, ‘myobject.ogg’, ‘my-testfile’)
File “/usr/local/lib/python3.5/site-packages/minio/api.py”, line 564, in fput_object
content_type=content_type)
File “/usr/local/lib/python3.5/site-packages/minio/api.py”, line 1436, in _do_put_object
content_sha256=sha256_hex)
File “/usr/local/lib/python3.5/site-packages/minio/api.py”, line 1700, in _url_open
region = self._get_bucket_region(bucket_name)
File “/usr/local/lib/python3.5/site-packages/minio/api.py”, line 1646, in _get_bucket_region
region = self._get_bucket_location(bucket_name)
File “/usr/local/lib/python3.5/site-packages/minio/api.py”, line 1670, in _get_bucket_location
self._secret_key, None)
File “/usr/local/lib/python3.5/site-packages/minio/signer.py”, line 199, in sign_v4
headers[‘X-Amz-Content-Sha256’] = content_sha256.decode(‘ascii’)
AttributeError: ‘str’ object has no attribute ‘decode’
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
You are welcome @okrause - we will soon make a release.
Seems to be fixed. Python3 now runs into the same TLSV1 error as python2. Behaviour is consistent, problem seems unrelated. Many thanks for the quick fix.