mirror of
https://github.com/python/cpython.git
synced 2025-08-19 08:11:46 +00:00
working with relative paths to avoid tar warnings on absolute paths
This commit is contained in:
parent
fcc7f039ec
commit
6deb574be3
1 changed files with 14 additions and 2 deletions
|
@ -27,7 +27,14 @@ class ArchiveUtilTestCase(support.TempdirManager,
|
||||||
|
|
||||||
tmpdir2 = self.mkdtemp()
|
tmpdir2 = self.mkdtemp()
|
||||||
base_name = os.path.join(tmpdir2, 'archive')
|
base_name = os.path.join(tmpdir2, 'archive')
|
||||||
make_tarball(base_name, tmpdir)
|
|
||||||
|
# working with relative paths to avoid tar warnings
|
||||||
|
old_dir = os.getcwd()
|
||||||
|
os.chdir(tmpdir)
|
||||||
|
try:
|
||||||
|
make_tarball(base_name, '.')
|
||||||
|
finally:
|
||||||
|
os.chdir(old_dir)
|
||||||
|
|
||||||
# check if the compressed tarball was created
|
# check if the compressed tarball was created
|
||||||
tarball = base_name + '.tar.gz'
|
tarball = base_name + '.tar.gz'
|
||||||
|
@ -35,7 +42,12 @@ class ArchiveUtilTestCase(support.TempdirManager,
|
||||||
|
|
||||||
# trying an uncompressed one
|
# trying an uncompressed one
|
||||||
base_name = os.path.join(tmpdir2, 'archive')
|
base_name = os.path.join(tmpdir2, 'archive')
|
||||||
make_tarball(base_name, tmpdir, compress=None)
|
old_dir = os.getcwd()
|
||||||
|
os.chdir(tmpdir)
|
||||||
|
try:
|
||||||
|
make_tarball(base_name, '.', compress=None)
|
||||||
|
finally:
|
||||||
|
os.chdir(old_dir)
|
||||||
tarball = base_name + '.tar'
|
tarball = base_name + '.tar'
|
||||||
self.assert_(os.path.exists(tarball))
|
self.assert_(os.path.exists(tarball))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue