Skip to content

Commit

Permalink
updated os.open to preserve mode (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
jahrules authored Mar 24, 2023
1 parent b222c42 commit 745da61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog
=========
v3.10.4 (2023-03-24)
--------------------
- Update os.open to preserve mode= for certain edge cases. by :user:`jahrules`.

v3.10.3 (2023-03-23)
--------------------
- Fix permission issue - by :user:`jahrules`.
Expand Down
2 changes: 1 addition & 1 deletion src/filelock/_unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class UnixFileLock(BaseFileLock):

def _acquire(self) -> None:
open_flags = os.O_RDWR | os.O_CREAT | os.O_TRUNC
fd = os.open(self._lock_file, open_flags)
fd = os.open(self._lock_file, open_flags, self._mode)
try:
os.chmod(fd, self._mode)
except PermissionError:
Expand Down

0 comments on commit 745da61

Please sign in to comment.