Add a shared Windows replace fallback helper
os.replace can fail on Windows even when the temp file and the destination are in the same directory on the same drive: WinError 17, "cannot move to a different disk drive", maps to a plain OSError in Python rather than PermissionError, so the existing copy then delete fallback for WinError 5 and 32 never caught it. Adds os_replace_with_fallback, checking both PermissionError and winerror 17, and points the shared atomic writer at it instead of its own inline PermissionError only version. Toward #3508. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh (cherry picked from commit 32cbf1f83ef913725fa7eb309822990a96d7fd23)
A
ayushcodes10 committed
df5a9042e37e91885f98c1faaaf494de803cbda0
Parent: 522ea96
Committed by safishamsi <safishamsi98@gmail.com>
on 9/12/2026, 4:36:09 PM