From f18d86eca09ccb228677f77def054f40f4ee0dd3 Mon Sep 17 00:00:00 2001 From: Jonathan Bouzekri Date: Sat, 13 Mar 2021 13:49:20 +0100 Subject: [PATCH] make pypi html parser regex less greedy --- Utility/Python/import_py3package_from_pypi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utility/Python/import_py3package_from_pypi.py b/Utility/Python/import_py3package_from_pypi.py index adcca9c..c47ac0a 100644 --- a/Utility/Python/import_py3package_from_pypi.py +++ b/Utility/Python/import_py3package_from_pypi.py @@ -66,7 +66,7 @@ def get_packagename_from_filename(packagefilename): def resolve_download_url(packagename, packagefilename): response = requests.get("%s/%s" % (PYPI_ENDPOINT, packagename)) - download_uri_regex = "%s<" % packagefilename + download_uri_regex = "]*?>%s<" % packagefilename download_uri_match = re.search(download_uri_regex, str(response.content)) print ("Detected download uri %s for %s" % (download_uri_match.group(1), packagename)) return download_uri_match.group(1)