Use the replace fallback for GraphML export

The GraphML writer replaced its temp file directly with no Windows
fallback of any kind, so a mid size export could hit the same class
of failure as the cache and install paths.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017qfdzgbA5KedGEjD1AayNh
(cherry picked from commit ab2bde0956)
This commit is contained in:
ayushcodes10 authored and safishamsi committed 2026-09-12 17:36:09 +01:00
1 parent f71e75eb31
commit c9aff7fb06
1 file changed
+7 -2
+7 -2
View File
@@ -16,7 +16,12 @@ from networkx.readwrite import json_graph
from graphify.security import sanitize_label
from graphify.analyze import _node_community_map
from graphify.build import edge_data
from graphify.paths import stem_filename_budget, write_json_atomic, write_text_atomic
from graphify.paths import (
os_replace_with_fallback,
stem_filename_budget,
write_json_atomic,
write_text_atomic,
)
from graphify.exporters.graphdb import push_to_falkordb, push_to_neo4j # noqa: E402,F401
@@ -1270,7 +1275,7 @@ def to_graphml(
tmp = out.with_name(out.name + ".tmp")
try:
nx.write_graphml(H, str(tmp))
os.replace(str(tmp), str(out))
os_replace_with_fallback(str(tmp), str(out))
finally:
if tmp.exists():
try: