You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
update/cluster-only fail with os.replace WinError 5 on VMware HGFS shared folders (read-then-replace over existing graph.json) #2689
graphify: 0.9.41 OS: Windows Server 2019, Python 3.14 Filesystem: repo on a VMware Shared Folders drive (\\vmware-host\Shared Folders, HGFS)
Summary
On a repo hosted on a VMware HGFS shared drive, graphify update . (and any command
that rewrites an existing graph.json, e.g. cluster-only, label) fails at the final
atomic write:
The graph is computed correctly (.graph.tmp.json is written); only the os.replace()
onto the existing graph.json fails. Because the run aborts there, GRAPH_REPORT.md, graph.html, and manifest.json are never written. The un-advanced manifest means every
later run re-detects the same delta and fails at the same spot, so incremental updates are
permanently blocked on this filesystem.
Looks related to #287 (also os.replace WinError 5) but still reproduces on 0.9.41, so
that fix does not cover this path.
Root cause
On HGFS, os.replace(tmp, dst) raises PermissionError(13) when dst was read earlier
in the same process before being replaced. graphify's incremental write reads the existing graph.json (merge / shrink-guard), then os.replace()s the temp over it, which HGFS denies.
First-ever builds succeed because there is no existing graph.json to read.
Minimal reproduction (no graphify required)
On a VMware HGFS shared drive:
import os
open('dst.json', 'w').write('x' * 1_300_000)
_ = open('dst.json').read() # read before replace (the trigger)
open('.tmp.json', 'w').write('y' * 1_500_000)
os.replace('.tmp.json', 'dst.json') # PermissionError(13, 'Access is denied') on HGFS
Controls (same machine, same code):
Remove the intervening read() and os.replace succeeds on the same HGFS share.
os.remove('dst.json'); os.rename('.tmp.json', 'dst.json') (delete-then-rename) succeeds even with the read.
Run the exact snippet on a local NTFS path (C:\...) and it succeeds.
So it is specific to (read-then-replace) on HGFS, not a general Windows or handle-leak issue.
Suggested fix
Fall back to delete-then-rename when os.replace raises PermissionError / WinError 5:
Activity
Add regression test for the clustered path replace fallback
safishamsi commentedon Sep 15, 2026
Fixed in v0.9.62 (on PyPI) via #3555, thanks @ayushcodes10. Thanks for the report!