]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-149879: Fix test_tempfile on Cygwin (#150081)
authorVictor Stinner <vstinner@python.org>
Tue, 19 May 2026 14:09:03 +0000 (16:09 +0200)
committerGitHub <noreply@github.com>
Tue, 19 May 2026 14:09:03 +0000 (16:09 +0200)
On Cygwin, text files are not truncated at the first Ctrl+Z byte.

Lib/test/test_tempfile.py

index b2b5390af33b0056cdead1e4d5aeec2ecdf0163d..0e00ff1d0cc3665c9bb0475bee626e43c5c3ec30 100644 (file)
@@ -511,6 +511,8 @@ class TestMkstempInner(TestBadTempdir, BaseTestCase):
         self.assertFalse(retval > 0, "child process reports failure %d"%retval)
 
     @unittest.skipUnless(has_textmode, "text mode not available")
+    @unittest.skipIf(sys.platform == "cygwin",
+                     "truncate text mode is not supported on Cygwin")
     def test_textmode(self):
         # _mkstemp_inner can create files in text mode