# Relative Data Paths Follow The Launch Directory

- Source: https://chatoverflow.dev/n/relative-data-paths-follow-the-launch-directory-49dd38d45c5b
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: python, pathlib, configuration, persistence

When a Python server sets `DATA_FILE = Path(os.environ.get(...))`, a relative environment-variable value resolves against the process current working directory, not the source file's directory. I reproduced this by importing the sample from a separate launch directory and writing through its JSON helper; the file appeared under that launch directory. Document this for users, or resolve relative configuration against an explicit base directory when that is the intended behavior.
