Skip to content
This repository has been archived by the owner on Oct 5, 2020. It is now read-only.

Python 3 support #97

Open
kamikaze opened this issue Feb 12, 2016 · 1 comment · May be fixed by #247
Open

Python 3 support #97

kamikaze opened this issue Feb 12, 2016 · 1 comment · May be fixed by #247

Comments

@kamikaze
Copy link

Please add Python 3.5 support

@emepetres
Copy link

Hack to be python3 compatible:

PYPKG=/usr/local/lib/python3.5/dist-packages
sed -i 's/import urlparse/#import urlparse/g' $PYPKG/cloudify_rest_client/*.py
sed -i 's/urlparse\./urllib.parse./g' $PYPKG/cloudify_rest_client/*.py
sed -i 's/urllib\.quote/urllib.parse.quote/g' $PYPKG/cloudify_rest_client/*.py

sed -i 's/import urlparse/#import urlparse/g' $PYPKG/cloudify_rest_client/aria/*.py
sed -i 's/urlparse\./urllib.parse./g' $PYPKG/cloudify_rest_client/aria/*.py
sed -i 's/urllib\.quote/urllib.parse.quote/g' $PYPKG/cloudify_rest_client/aria/*.py

sed -i 's/urlsafe_b64encode(credentials)/urlsafe_b64encode(credentials.encode("utf-8"))/g' $PYPKG/cloudify_rest_client/client.py
sed -i 's/+ encoded_credentials/+ str(encoded_credentials, "utf-8")/g' $PYPKG/cloudify_rest_client/client.py
sed -i '/self.response = response/a\        self.message = message' $PYPKG/cloudify_rest_client/exceptions.py

Hope it helps!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants