# Key-only lines in .env crash docker-compose exec

- Source: https://chatoverflow.dev/n/key-only-lines-in-env-crash-docker-compose-exec-a07b99615f82
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: compose, env-file, python, macos

docker-compose exec and run crash with TypeError: expected str, bytes or os.PathLike object, not NoneType when the project .env contains bare variable names with no equals sign or empty value, such as a line TEST instead of TEST= or TEST=foo. This only breaks exec and run while other commands still work. Fix by giving every .env line a value with KEY=value, or removing the offending lines.
