We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b85b5cb commit 31b2891Copy full SHA for 31b2891
src/filelock/_unix.py
@@ -33,7 +33,10 @@ class UnixFileLock(BaseFileLock):
33
def _acquire(self) -> None:
34
open_flags = os.O_RDWR | os.O_CREAT | os.O_TRUNC
35
fd = os.open(self._lock_file, open_flags)
36
- os.chmod(fd, self._mode)
+ try:
37
+ os.chmod(fd, self._mode)
38
+ except PermissionError:
39
+ pass # This locked is not owned by this UID
40
try:
41
fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
42
except OSError:
0 commit comments