Skip to content
This repository was archived by the owner on Oct 9, 2018. It is now read-only.
This repository was archived by the owner on Oct 9, 2018. It is now read-only.

os.path.join() is used for building urls #25

Description

@Marm0t

Hello.

As it written in title of this issue os.path.join() is used in someplaces for building urls.
For example in oauth.py:

class OAuth(Namespace):
 [...]
    request_token_url = os.path.join(
        BASE_URL, 'api/auth/v1/oauth/token/request')
    authorize_url = os.path.join(BASE_URL, 'services/api/auth')
    access_token_url = os.path.join(BASE_URL, 'api/auth/v1/oauth/token/access')
 [...]

normally it works fine but for urls os.path.join is not the best either since on Windows systems os.path.join will join using backslash \ which won't be a valid url. As consequence on windows we get exception like this:
Unable to find the server at www.odesk.com\api

Isn't it better to use urlparse.urljoin (and urllib.parse.urljoin for python 3) for this?
Otherwise it should be written somewhere in documentation that Windows is not supported.

Best regards.

Activity

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