Skip to content

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

Closed

Description

@mdhausman

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.

Activity

  1. anthrotype commented on Jun 5, 2017

    @anthrotype

    Fixed in master
    #268

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

  2. mdhausman commented on Jun 5, 2017

    @mdhausman
    Author

    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.

  3. gpocentek commented on Jun 11, 2017

    @gpocentek
    Contributor

    0.21.2 has the fix.

  4. locked as resolved and limited conversation to collaborators on Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions