changeset: 98067:fe84898fbe98 branch: 2.7 parent: 98060:f211c8f554f9 user: Serhiy Storchaka date: Sat Sep 19 10:55:20 2015 +0300 files: Lib/test/test_zipfile.py description: Issue #25101: Try to create a file to test write access in test_zipfile. diff -r f211c8f554f9 -r fe84898fbe98 Lib/test/test_zipfile.py --- a/Lib/test/test_zipfile.py Fri Sep 18 15:11:26 2015 -0700 +++ b/Lib/test/test_zipfile.py Sat Sep 19 10:55:20 2015 +0300 @@ -778,6 +778,13 @@ def requiresWriteAccess(self, path): if not os.access(path, os.W_OK): 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__))