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
cc51ff77
Commit
cc51ff77
authored
May 25, 2013
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix use of getheaders on Python 3
parent
59d45d94
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
66 deletions
+80
-66
setuptools.egg-info/entry_points.txt
setuptools.egg-info/entry_points.txt
+62
-62
setuptools/package_index.py
setuptools/package_index.py
+3
-4
setuptools/py27compat.py
setuptools/py27compat.py
+15
-0
No files found.
setuptools.egg-info/entry_points.txt
View file @
cc51ff77
setuptools/package_index.py
View file @
cc51ff77
...
...
@@ -13,6 +13,7 @@ except ImportError:
from
md5
import
md5
from
fnmatch
import
translate
from
.py24compat
import
wraps
from
setuptools.py27compat
import
get_all_headers
EGG_FRAGMENT
=
re
.
compile
(
r'^egg=([-A-Za-z0-9_.]+)$'
)
HREF
=
re
.
compile
(
"""href
\
\
s*=
\
\
s*['"]?([^'"> ]+)"""
,
re
.
I
)
...
...
@@ -608,10 +609,8 @@ class PackageIndex(Environment):
size
=
-
1
if
"content-length"
in
headers
:
# Some servers return multiple Content-Length headers :(
if
not
hasattr
(
headers
,
'get_all'
):
# Older versions of Python don't have the get_all method
headers
.
get_all
=
headers
.
getheaders
size
=
max
(
map
(
int
,
headers
.
get_all
(
"Content-Length"
)))
sizes
=
get_all_headers
(
headers
,
'Content-Length'
)
size
=
max
(
map
(
int
,
sizes
))
self
.
reporthook
(
url
,
filename
,
blocknum
,
bs
,
size
)
tfp
=
open
(
filename
,
'wb'
)
while
True
:
...
...
setuptools/py27compat.py
0 → 100644
View file @
cc51ff77
"""
Compatibility Support for Python 2.7 and earlier
"""
import
sys
def
get_all_headers
(
message
,
key
):
"""
Given an HTTPMessage, return all headers matching a given key.
"""
return
message
.
get_all
(
key
)
if
sys
.
version_info
<
(
3
,):
def
get_all_headers
(
message
,
key
):
return
message
.
getheaders
(
key
)
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