Skip to content

0.158.6: two file names that fold to one are refused - #83

Merged
tmoosting merged 2 commits into
mainfrom
case-collide
Nov 28, 2026
Merged

tmoosting merged 2 commits into
mainfrom
case-collide

Conversation

@tmoosting

Copy link
Copy Markdown
Member

Fixed: two elements whose file names differ only in case are refused, where one of them was lost. The folder writer names a file from the element's id. When two ids of one type differ only in case (Ab1 and ab1, unnamed or both named Bob), it gave them file names that also differ only in case, and a case-insensitive disk kept one file for both (measured on NTFS: one file for two elements). The writer now refuses, before any file is made, two final file names in one type folder that are one name under the folder format's name fold (NFC, then simple case folding, as the archive reader compares names), naming both ids. Also refused: an unnamed id bob--x beside an element x named Bob, which both get bob--x.json on any disk. 14 refused and 7 written cases are shared byte for byte with the other package. The collision rule's own choice of names is unchanged.

🤖 Generated with Claude Code

tmoosting and others added 2 commits November 28, 2026 18:13
…ne name

When two element ids of one type differ only in case (Ab1 and ab1, unnamed or
both named Bob), the collision rule gave them file names that also differ only
in case, and a case-insensitive disk (NTFS, APFS) kept one file for both: the
folder held one element where the world had two. An unnamed id bob--x beside an
element x named Bob was written as bob--x.json twice.

Once the collision rule has chosen every name in a type folder, two names equal
under the folder format's name fold, NFC then simple case folding
(_fold_name, the archive reader's), now raise ValueError before
anything is written, naming the type, both ids in code point order and both
file names. The import doors and export_world write through write_folder. No
name the rule chose before changes. The cases are shared byte for byte with the
npm SDK (tests/fixtures/case-collide.cases.json, its sha256 held in the test).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tmoosting
tmoosting merged commit f963687 into main Nov 28, 2026
11 checks passed

This branch was successfully deployed

1 active deployment
pypi — f963687d Deployed Nov 28, 2026 by tmoosting via publish #261
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant