From 6c300f41dd228a1912dc9617632d3cfd70c696b5 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 8 Oct 2017 16:46:15 +0200 Subject: [PATCH] Don't use urllib.parse.urljoin to concatenate URLs It doesn't support more than two arguments, and it's not really needed with the predictable URLs we have anyways. See #2891. --- scripts/install_dict.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/install_dict.py b/scripts/install_dict.py index 7ce333848..79c9ff122 100755 --- a/scripts/install_dict.py +++ b/scripts/install_dict.py @@ -29,7 +29,6 @@ import json import os import sys import re -import urllib.parse import urllib.request import attr @@ -91,7 +90,7 @@ def valid_languages(): def language_list_from_api(): """Return a JSON with a list of available languages from Google API.""" - listurl = urllib.parse.urljoin(API_URL, '?format=JSON') + listurl = API_URL + '?format=JSON' response = urllib.request.urlopen(listurl) # A special 5-byte prefix must be stripped from the response content # See: https://github.com/google/gitiles/issues/22 @@ -147,7 +146,7 @@ def filter_languages(languages, selected): def install_lang(lang): """Install a single lang given by the argument.""" print('Installing {}: {}'.format(lang.code, lang.name)) - lang_url = urllib.parse.urljoin(API_URL, lang.file_path, '?format=TEXT') + lang_url = API_URL + lang.file_path + '?format=TEXT' if not os.path.isdir(spell.dictionary_dir()): warn_msg = '{} does not exist, creating the directory' print(warn_msg.format(spell.dictionary_dir()))