From 08d82cd9f21cbe8597e2e7032799c3ced7bfae5b Mon Sep 17 00:00:00 2001 From: Patrick Hagemeister Date: Thu, 27 Jul 2023 06:29:23 +0000 Subject: [PATCH] #1566 Creating a lock now uses python built-in "open()" method to work around docker virtiofs issue (backport to 1.0.2) --- git/util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git/util.py b/git/util.py index 00f03f6f6..4a791dc9f 100644 --- a/git/util.py +++ b/git/util.py @@ -539,8 +539,7 @@ def _obtain_lock_or_raise(self): (self._file_path, lock_file)) try: - fd = os.open(lock_file, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0) - os.close(fd) + open(lock_file, mode='w', closefd=True) except OSError as e: raise IOError(str(e))