diff -r 63c5531cfdf7 Lib/distutils/tests/test_archive_util.py --- a/Lib/distutils/tests/test_archive_util.py Sat Jan 07 09:33:28 2017 +0300 +++ b/Lib/distutils/tests/test_archive_util.py Sat Jan 07 16:36:51 2017 +0100 @@ -162,7 +162,9 @@ # 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'] + # Issue 29185: use separate command line options as gzip on Android + # API 24 understands '-f9' as the name of a file. + gzip_cmd = ['gzip', '-f', '-9', 'archive2.tar'] old_dir = os.getcwd() os.chdir(tmpdir) try: diff -r 63c5531cfdf7 Lib/distutils/tests/test_file_util.py --- a/Lib/distutils/tests/test_file_util.py Sat Jan 07 09:33:28 2017 +0300 +++ b/Lib/distutils/tests/test_file_util.py Sat Jan 07 16:36:51 2017 +0100 @@ -84,6 +84,12 @@ copy_file(self.source, self.target, link='hard') st2 = os.stat(self.source) st3 = os.stat(self.target) + # Use the original inode number for the stat structures comparison as + # copy_file() falls back on copying file when os.link() fails (some + # systems don't support hard linking, e.g. Android see issue #29185). + if st2.st_ino != st3.st_ino: + st3 = os.stat_result([x if i != 1 else st2.st_ino + for (i, x) in enumerate(st3)]) self.assertTrue(os.path.samestat(st, st2), (st, st2)) self.assertTrue(os.path.samestat(st2, st3), (st2, st3)) with open(self.source, 'r') as f: