question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python3 incompability in signer.py

See original GitHub issue

Just 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:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
harshavardhanacommented, Nov 10, 2016

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.

You are welcome @okrause - we will soon make a release.

0reactions
okrausecommented, Nov 10, 2016

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incompatible taps & targets · Issue #102 · singer-io ... - GitHub
At this point I've found it impossible to continue with any singer project, as basically no combination of taps & target work together...
Read more >
How to detect if code is python 3 compatible - Stack Overflow
Have a python3 program load the python modules (without executing them). If the code is compatible, it will load the module, if it...
Read more >
python-cheatsheet Documentation - Read the Docs
Welcome to pysheeet. This project aims at collecting useful Python snippets in order to enhance pythoneers' coding ex- periences.
Read more >
Porting Python 2 Code to Python 3 — Python 3.11.1 ...
Under Python 3, binary files and text files are clearly distinct and mutually incompatible; see the io module for details. Therefore, you must...
Read more >
Changelog — Cryptography 3.4.8 documentation
BACKWARDS INCOMPATIBLE: When deserializing asymmetric keys we now raise ValueError rather than UnsupportedAlgorithm when an unsupported cipher ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found