Skip to content

Commit

Permalink
Use chmod after close for windows compat
Browse files Browse the repository at this point in the history
  • Loading branch information
thatch committed May 8, 2024
1 parent ef19577 commit 05e1119
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cachecontrol/caches/file_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def _write(self, path: str, data: bytes) -> None:
# Write our actual file
(fd, name) = tempfile.mkstemp(dir=dirname)
os.write(fd, data)
os.fchmod(fd, self.filemode)
os.close(fd)
os.chmod(name, self.filemode)
os.replace(name, path)

def _delete(self, key: str, suffix: str) -> None:
Expand Down

0 comments on commit 05e1119

Please sign in to comment.