summaryrefslogtreecommitdiff
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/package_index.py')
-rwxr-xr-xsetuptools/package_index.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 619649b9..cda54b71 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -934,12 +934,19 @@ entity_sub = re.compile(r'&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?').sub
def decode_entity(match):
- what = match.group(1)
+ what = match.group(0)
return unescape(what)
def htmldecode(text):
- """Decode HTML entities in the given text."""
+ """
+ Decode HTML entities in the given text.
+
+ >>> htmldecode(
+ ... 'https://../package_name-0.1.2.tar.gz'
+ ... '?tokena=A&tokenb=B">package_name-0.1.2.tar.gz')
+ 'https://../package_name-0.1.2.tar.gz?tokena=A&tokenb=B">package_name-0.1.2.tar.gz'
+ """
return entity_sub(decode_entity, text)