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
d716b3c0
Commit
d716b3c0
authored
Jan 16, 2016
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-use tarfile_open for Python 2.6 compatibilty.
parent
efb37fc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
setuptools/tests/test_easy_install.py
setuptools/tests/test_easy_install.py
+2
-6
No files found.
setuptools/tests/test_easy_install.py
View file @
d716b3c0
...
...
@@ -364,7 +364,7 @@ class TestSetupRequires:
# extracted path to sys.path so foo.bar v0.1 is importable
foobar_1_dir
=
os
.
path
.
join
(
temp_dir
,
'foo.bar-0.1'
)
os
.
mkdir
(
foobar_1_dir
)
with
tarfile
.
open
(
foobar_1_archive
)
as
tf
:
with
tarfile
_
open
(
foobar_1_archive
)
as
tf
:
tf
.
extractall
(
foobar_1_dir
)
sys
.
path
.
insert
(
1
,
foobar_1_dir
)
...
...
@@ -462,17 +462,13 @@ def make_sdist(dist_path, files):
listed in ``files`` as ``(filename, content)`` tuples.
"""
dist
=
tarfile
.
open
(
dist_path
,
'w:gz'
)
try
:
with
tarfile_open
(
dist_path
,
'w:gz'
)
as
dist
:
for
filename
,
content
in
files
:
file_bytes
=
io
.
BytesIO
(
content
.
encode
(
'utf-8'
))
file_info
=
tarfile
.
TarInfo
(
name
=
filename
)
file_info
.
size
=
len
(
file_bytes
.
getvalue
())
file_info
.
mtime
=
int
(
time
.
time
())
dist
.
addfile
(
file_info
,
fileobj
=
file_bytes
)
finally
:
dist
.
close
()
def
create_setup_requires_package
(
path
,
distname
=
'foobar'
,
version
=
'0.1'
,
...
...
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