Projects
openEuler:24.03:SP1:Everything
python-filelock
_service:tar_scm:0001-BugFix-fix-permission-den...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:0001-BugFix-fix-permission-denied-error-when-lock-file-is.patch of Package python-filelock
From 9a6437521131490a72e68813164885cecfd1232d Mon Sep 17 00:00:00 2001 From: kota-iizuka <64062831+kota-iizuka@users.noreply.github.com> Date: Mon, 25 Mar 2024 23:24:53 +0900 Subject: [PATCH] [BugFix] fix permission denied error when lock file is placed in `/tmp` (#317) --- src/filelock/_unix.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/filelock/_unix.py b/src/filelock/_unix.py index 4ee6033..4ae1fbe 100644 --- a/src/filelock/_unix.py +++ b/src/filelock/_unix.py @@ -4,6 +4,7 @@ import os import sys from contextlib import suppress from errno import ENOSYS +from pathlib import Path from typing import cast from ._api import BaseFileLock @@ -35,7 +36,9 @@ else: # pragma: win32 no cover def _acquire(self) -> None: ensure_directory_exists(self.lock_file) - open_flags = os.O_RDWR | os.O_CREAT | os.O_TRUNC + open_flags = os.O_RDWR | os.O_TRUNC + if not Path(self.lock_file).exists(): + open_flags |= os.O_CREAT fd = os.open(self.lock_file, open_flags, self._context.mode) with suppress(PermissionError): # This locked is not owned by this UID os.fchmod(fd, self._context.mode) -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2