]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #25101: Try to create a file to test write access in test_zipfile.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 19 Sep 2015 07:55:20 +0000 (10:55 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 19 Sep 2015 07:55:20 +0000 (10:55 +0300)
Lib/test/test_zipfile.py

index 0c4c5791c480c943444a958ece096fd1ac11aa5f..4bdf7d4f7e34a13fbb0b91d14f98716c2a78d275 100644 (file)
@@ -653,6 +653,13 @@ class PyZipFileTests(unittest.TestCase):
         if not os.access(path, os.W_OK,
                          effective_ids=os.access in os.supports_effective_ids):
             self.skipTest('requires write access to the installed location')
+        filename = os.path.join(path, 'test_zipfile.try')
+        try:
+            fd = os.open(filename, os.O_WRONLY | os.O_CREAT)
+            os.close(fd)
+        except Exception:
+            self.skipTest('requires write access to the installed location')
+        unlink(filename)
 
     def test_write_pyfile(self):
         self.requiresWriteAccess(os.path.dirname(__file__))