Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
6fba91c1
Commit
6fba91c1
authored
Mar 17, 2018
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rely on stdlib to decode entities.
parent
e141c08e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
15 deletions
+11
-15
setuptools/package_index.py
setuptools/package_index.py
+2
-15
setuptools/py33compat.py
setuptools/py33compat.py
+9
-0
No files found.
setuptools/package_index.py
View file @
6fba91c1
...
...
@@ -23,6 +23,7 @@ from distutils import log
from
distutils.errors
import
DistutilsError
from
fnmatch
import
translate
from
setuptools.py27compat
import
get_all_headers
from
setuptools.py33compat
import
unescape
from
setuptools.wheel
import
Wheel
EGG_FRAGMENT
=
re
.
compile
(
r'^egg=([-A-Za-z0-9_.+!]+)$'
)
...
...
@@ -931,23 +932,9 @@ class PackageIndex(Environment):
entity_sub = re.compile(r'&(#(
\
d+|x[
\
da-fA-F]+)|[
\
w.:-]+);?
'
).sub
def uchr(c):
if not isinstance(c, int):
return c
if c > 255:
return six.unichr(c)
return chr(c)
def decode_entity(match):
what = match.group(1)
if what.startswith('#x'):
what = int(what[2:], 16)
elif what.startswith('#'):
what = int(what[1:])
else:
what = six.moves.html_entities.name2codepoint.get(what, match.group(0))
return uchr(what)
return unescape(what)
def htmldecode(text):
...
...
setuptools/py33compat.py
View file @
6fba91c1
...
...
@@ -2,7 +2,13 @@ import dis
import
array
import
collections
try
:
import
html
except
ImportError
:
html
=
None
from
setuptools.extern
import
six
from
setuptools.extern.six.moves
import
html_parser
OpArg
=
collections
.
namedtuple
(
'OpArg'
,
'opcode arg'
)
...
...
@@ -43,3 +49,6 @@ class Bytecode_compat(object):
Bytecode
=
getattr
(
dis
,
'Bytecode'
,
Bytecode_compat
)
unescape
=
getattr
(
html
,
'unescape'
,
html_parser
.
HTMLParser
().
unescape
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment