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
export wiki: a community relabelled only by case loses its article on case-insensitive filesystems (orphan sweep compares names case-sensitively) #4508
On a case-insensitive filesystem (the macOS APFS default; also NTFS), to_wiki deletes a community's article when the community's label changes only in letter case between two exports, for example groups → Groups. index.md still links to Groups.md, which no longer exists.
The cause is the end-of-run orphan sweep in graphify/wiki.py (to_wiki, around line 451):
produced contains Groups.md. On a case-preserving, case-insensitive filesystem, the existing directory entry keeps its old name, groups.md: the atomic write replaces the file's contents but not the name's case. "groups.md" not in {"Groups.md"} is true, so the sweep unlinks groups.md, which is the very file this run just wrote.
Expected: the article survives, ideally under the new case, and the link in index.md resolves.
_unique_slug already folds case when it checks for collisions, so the sweep looks like the one remaining case-sensitive comparison. Possible fixes:
compare folded names, e.g. old_article.name.casefold() not in {p.casefold() for p in produced};
or skip any path that os.path.samefiles a produced one.
To get the new case onto disk as well, rename case-only changes before writing.
The end-of-run sweep arrived with the #3060 fix. The earlier up-front unlink, as I understand it, didn't have this problem.
In practice it happens when graphify label or a manual relabel changes only the case of a community name, or when re-clustering gives a community a hub-derived name that differs only in case.
Only the export that changes the case loses the article. The next export with the same labels writes it again, so the wiki stays broken until another export runs.
Activity
github-actions commentedon Oct 17, 2026
Thanks for opening this issue, @nzabate. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.