Skip to content

Commit 4eb4f81

Browse files
committed
gh-88661: Give the command-line test cases distinct stems
The three names differed only in case, so on a case-insensitive filesystem the second write landed on the first file. The iOS simulator is one, and the job failed there with FileExistsError.
1 parent 27521dd commit 4eb4f81

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎Lib/test/test_gzip.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,9 +1201,11 @@ def test_decompress_infile_outfile_error(self):
12011201
def test_decompress_suffix_like_gunzip(self):
12021202
# gh-88661: the command line accepts the names gunzip accepts, and
12031203
# writes the name gunzip would write.
1204-
for name, expected in (('testgzip.tgz', 'testgzip.tar'),
1205-
('testgzip.TGZ', 'testgzip.tar'),
1206-
('testgzip.GZ', 'testgzip')):
1204+
# Distinct stems: the names differ only in case on some platforms,
1205+
# and a case-insensitive filesystem would have them collide.
1206+
for name, expected in (('lower.tgz', 'lower.tar'),
1207+
('upper.TGZ', 'upper.tar'),
1208+
('caps.GZ', 'caps')):
12071209
with self.subTest(name=name):
12081210
path = os.path.join(TEMPDIR, name)
12091211
with gzip.open(path, mode='wb') as fp:

0 commit comments

Comments
 (0)