Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/distutils/tests/test_archive_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def test_tarfile_vs_tar(self):
# now create another tarball using `tar`
tarball2 = os.path.join(tmpdir, 'archive2.tar.gz')
tar_cmd = ['tar', '-cf', 'archive2.tar', 'dist']
gzip_cmd = ['gzip', '-f9', 'archive2.tar']
gzip_cmd = ['gzip', '-f', '-9', 'archive2.tar']
old_dir = os.getcwd()
os.chdir(tmpdir)
try:
Expand Down
10 changes: 9 additions & 1 deletion Lib/distutils/tests/test_file_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from distutils import log
from distutils.tests import support
from distutils.errors import DistutilsFileError
from test.support import run_unittest
from test.support import run_unittest, unlink

class FileUtilTestCase(support.TempdirManager, unittest.TestCase):

Expand Down Expand Up @@ -80,6 +80,14 @@ def test_move_file_exception_unpacking_unlink(self):
def test_copy_file_hard_link(self):
with open(self.source, 'w') as f:
f.write('some content')
# Check first that copy_file() will not fall back on copying the file
# instead of creating the hard link.
try:
os.link(self.source, self.target)
except OSError as e:
self.skipTest('os.link: %s' % e)
else:
unlink(self.target)
st = os.stat(self.source)
copy_file(self.source, self.target, link='hard')
st2 = os.stat(self.source)
Expand Down