NFC-normalize a path string. macOS (HFS+/APFS) reports filenames in NFD while manifests, graph ``source_file`` entries and user input are typically NFC. Comparing raw strings makes the same file look like two different paths, so any path membership test must normalize BOTH sides (#2
(s: str)
| 709 | |
| 710 | |
| 711 | def nfc(s: str) -> str: |
| 712 | """NFC-normalize a path string. |
| 713 | |
| 714 | macOS (HFS+/APFS) reports filenames in NFD while manifests, graph |
| 715 | ``source_file`` entries and user input are typically NFC. Comparing raw |
| 716 | strings makes the same file look like two different paths, so any path |
| 717 | membership test must normalize BOTH sides (#2210, #2221/#2224). |
| 718 | """ |
| 719 | import unicodedata |
| 720 | return unicodedata.normalize("NFC", s) |
| 721 | |
| 722 | |
| 723 | def read_graph_json(path) -> dict: |
no test coverage detected