| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1ddf953 commit b438c45
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,8 @@ class TemporaryFileSwap: | |||
| 41 | 41 | ||
| 42 | 42 | def __init__(self, file_path: PathLike) -> None: | |
| 43 | 43 | self.file_path = file_path | |
| 44 | - fd, self.tmp_file_path = tempfile.mkstemp(prefix=str(self.file_path), dir="") | ||
| 44 | + dirname, basename = osp.split(file_path) | ||
| 45 | + fd, self.tmp_file_path = tempfile.mkstemp(prefix=basename, dir=dirname) | ||
| 45 | 46 | os.close(fd) | |
| 46 | 47 | with contextlib.suppress(OSError): # It may be that the source does not exist. | |
| 47 | 48 | os.replace(self.file_path, self.tmp_file_path) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments