localstack / awscli-local

💲 "awslocal" - Thin wrapper around the "aws" command line interface for use with LocalStack
Apache License 2.0
1.09k stars 86 forks source link

setup.py change breaks installation on python 2.7 #54

Closed cspotcode closed 2 years ago

cspotcode commented 2 years ago

My team uses awscli-local in some automated tests, and version 0.19 failed to install where 0.18 succeeded. The error we get is:

Downloading https://files.pythonhosted.org/packages/72/fe/c34701b02a6c5af1a89c6d14a02802f06b27a646a09380b2ecd957187cfc/awscli-local-0.19.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-sV1Llb/awscli-local/setup.py", line 5, in <module>
        with open('README.md', encoding='utf8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function

I'll admit I'm not a python expert, but I believe I've tracked it down to this change in setup.py:

https://github.com/localstack/awscli-local/compare/254273bce710eb69f50dcefe09e168f3d61bda60..master#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R5

with open('README.md', encoding='utf8') as f:

It looks like encoding is not accepted by open() on python 2.7: https://docs.python.org/2/library/functions.html#open

We have worked around the issue by pinning to version 0.18, but I wonder if our use-case is something that you are willing and able to support.

whummer commented 2 years ago

Thanks for reporting @cspotcode . We generally have dropped support for Python 2.x in LocalStack a while ago, but I think the awslocal CLI is a special case where we can continue trying to preserve backwards-compatibility. 👍 We'll release a patched version with a fix shortly.. (will ping you here once done)

whummer commented 2 years ago

Hi again @cspotcode . We have now pushed a version 0.20 which should (hopefully) fix this issue. Please let us know if the problem persists.. Thanks!

cspotcode commented 2 years ago

Thanks! I likely will not be able to test the new version, since pinning to 0.18 got me unblocked and then I had to merge and close that ticket. I realize that's not a great answer, but it is what it is.