Commit ccf48ca
committed
Use atomic file operations to ensure valid downloads
When downloading and caching files such as Python wheels, eggs, or zip
files, it's crucial to ensure that the files are fully and correctly
written before they are made available for use.
This change implements atomic file operations by writing to a temporary
file first and then renaming it to the target filename once the write is
complete and the file has been validated.
This prevents issues where a partially written or corrupt file could be
read by other processes.
Signed-off-by: Marcel Bochtler <[email protected]>1 parent 356dcda commit ccf48ca
1 file changed
+26
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1725 | 1725 | | |
1726 | 1726 | | |
1727 | 1727 | | |
1728 | | - | |
1729 | | - | |
1730 | | - | |
1731 | | - | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
1732 | 1754 | | |
1733 | 1755 | | |
1734 | 1756 | | |
| |||
0 commit comments