summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-09-19 07:55:20 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-09-19 07:55:20 (GMT)
commitd86a6ef41c7ef746ca871c2c1a74999327d73a7d (patch)
treec41bbe3782bf37b013a8ab7557156f7e5c471bf4
parent53936474aa2e9057ff9fbb33fb641707e79bc3a2 (diff)
downloadcpython-d86a6ef41c7ef746ca871c2c1a74999327d73a7d.zip
cpython-d86a6ef41c7ef746ca871c2c1a74999327d73a7d.tar.gz
cpython-d86a6ef41c7ef746ca871c2c1a74999327d73a7d.tar.bz2
Issue #25101: Try to create a file to test write access in test_zipfile.
-rw-r--r--Lib/test/test_zipfile.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 0c4c579..4bdf7d4 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -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__))