Skip to content
This repository was archived by the owner on Jan 20, 2020. It is now read-only.

python3 support #7

Open
Bekt opened this issue Apr 27, 2016 · 7 comments
Open

python3 support #7

Bekt opened this issue Apr 27, 2016 · 7 comments

Comments

@Bekt
Copy link

Bekt commented Apr 27, 2016

The library doesn't seem to work with python3. A lot of people have moved away from python2, so it'd be nice to add support for python3 to take advantage of the library.

Python 3.5.1 (default, Dec 26 2015, 18:11:22)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import dockercloud
>>>
>>> dockercloud.Action.list()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../venv3/lib/python3.5/site-packages/dockercloud/api/base.py", line 149, in list
    json = send_request('GET', detail_uri, params=kwargs)
  File ".../venv3/lib/python3.5/site-packages/dockercloud/api/http.py", line 37, in send_request
    url = urljoin(dockercloud.rest_host.rstrip("/"), path.strip("/").encode("ascii", "ignore"))
  File ".../python3.5/urllib/parse.py", line 415, in urljoin
    base, url, _coerce_result = _coerce_args(base, url)
  File ".../python3.5/urllib/parse.py", line 111, in _coerce_args
    raise TypeError("Cannot mix str and non-str arguments")
TypeError: Cannot mix str and non-str arguments

I've tested the same code with python 2.7.10, and it works just fine.

arkka added a commit to arkka/python-dockercloud that referenced this issue Jul 29, 2016
I have this simple update to get my script working with Python 3. 
Can anyone clarify this?
@Midnighter
Copy link

Same experience for me, I put it in a forum post. Issue occurs with environment variables as well as with setting the relevant attributes.

@penkin
Copy link

penkin commented Mar 15, 2017

Any fix or work around for this?

@Midnighter
Copy link

There are some open pull requests that look promising...

@penkin
Copy link

penkin commented Mar 15, 2017

@Midnighter Also added a PR now as well #29. Tests pass in both Python2 and 3. Will see if it gets accepted. Tried to rebase my commits so it looked a little cleaner but could not it seems.

@brgirgis
Copy link

brgirgis commented Jan 16, 2018

Any update about this issue? Please let me know how I could help to accelerate any advancement toward a solution.

@mbdevpl
Copy link

mbdevpl commented May 9, 2018

I second this! PR #29 seems good.

My suggested workaround for the impatient:

pip3 install git+https://github.com/penkin/python-dockercloud

This will install the py3-compatible version.

@mbdevpl
Copy link

mbdevpl commented May 9, 2018

Oops, just noticed that this whole thing is deprecated...

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

No branches or pull requests

5 participants