Skip to content
Shihao Qi
ProjectsWritingNotesSearchAbout

TAG

File Paths

Everything filed under this tag.

1 entries

01Writing

Computing the project root twice: Path(__file__).parents[N] silently points elsewhere once the file moves2026-10-19Finding the project root by counting levels up from __file__ is a second copy of where the file lives, and it doesn’t update when the file moves or the snippet is copied to a different depth. In Autarkia one module wrote its data into an auto-created directory under core/, froze the old data, and never raised an error.#Python#Single Source of Truth#File Paths
← All tagsSearch the site
© 2026 Shihao Qi
TagsRSSGitHubEmail