Respect PYTHONDONTWRITEBYTECODE (/ add a way to configure env variables)

Resolved 💬 2 comments Opened Feb 17, 2026 by LoreRizzetto Closed Mar 29, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

CLI

What feature would you like to see?

Currently when codex is done developing something it tests if the code works, this often entails as a minimum compiling the code to check if the syntax is valid.
The issue is that it creates __pycache__ directories even though codex itself is ran with PYTHONDONTWRITEBYTECODE=1 (checked with !env | grep PYTHONDONTWRITEBYTECODE).
It would be cool if there was a way to configure the env variables used by codex, either by setting them explicitly or by choosing a subset that will be forwarded from the host environment.

Additional information

__pycache__ is pointless for single execution scripts since it won't ever be used again

View original on GitHub ↗

2 Comments

etraut-openai contributor · 6 months ago
etraut-openai contributor · 5 months ago

This feature request hasn't received enough upvotes, so I'm closing it.