Skip to content

AttributeError: module 'urllib' has no attribute 'urlencode' (Python 3, repository_blob) #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mdhausman opened this issue Jun 5, 2017 · 3 comments

Comments

@mdhausman
Copy link

Getting an issue in python 3.6 with the project.repository_blob function.

File "[blah blah blah]/lib/python3.6/site-packages/gitlab/v3/objects.py", line 1885, in repository_blob
    url += '?%s' % (urllib.urlencode({'filepath': filepath}))
AttributeError: module 'urllib' has no attribute 'urlencode'

urlencode was moved in py3 to urllib.parse.urlencode (https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode). For maintaining compatibility across python 2 and 3, consider six's six.moves.urllib instead of urllib itself.

@anthrotype
Copy link

Fixed in master
#268

@gpocentek would be nice to get a new release on PyPI as well :)

@mdhausman
Copy link
Author

mdhausman commented Jun 5, 2017

Hah, I was just about to come back and close this 'cause yeah, definitely fixed on master.

I'm gonna leave it open though, y'all can close it when you've uploaded 0.21.2 or 0.22.0 or what have you.

@gpocentek
Copy link
Contributor

0.21.2 has the fix.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2021
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

3 participants