Fixes · Checked on 2026-10-04
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/...'
The file is right there in Git Bash. Windows Python can't see it.
The error
$ echo hello > /tmp/notes.txt
$ python -c "print(open('/tmp/notes.txt').read())"
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/notes.txt'
The same happens with /c/Users/you/..., Git Bash's name for C:\Users\you.
Why it happens
-
The paths are Git Bash's own. Git Bash shows your drives as
/c/,/d/and so on, and/tmpis its name for your Windows temp folder (C:\Users\you\AppData\Local\Temp). -
Windows Python doesn't know them. To Python,
/tmp/notes.txtmeansC:\tmp\notes.txt, and/c/UsersmeansC:\c\Users. Neither exists. - Git Bash only converts arguments. When an argument looks like a path, Git Bash rewrites it before Python starts. A path inside your code is just text, so it gets through unchanged.
The fix
Any of these works:
-
Write the Windows path in the code. Forward slashes are fine:
open('C:/Users/you/AppData/Local/Temp/notes.txt'). - Convert it first.
cygpath -m /tmp/notes.txtprintsC:/Users/you/AppData/Local/Temp/notes.txt. -
Pass the path as an argument. Git Bash converts it on the way in:
$ python -c "import sys; print(sys.argv[1])" /tmp/notes.txt C:/Users/you/AppData/Local/Temp/notes.txt - Use a path relative to the current folder, which means the same in both.
How DMN learned it
It came up, and was fixed, in 8 of our own sessions. DMN kept the fix as one line:
Windows Python can't open Git Bash paths like /c/Users/... or /tmp/...; pass Windows-style paths
(C:/Users/...) or paths relative to the cwd to python's open().
DMN reads your agents' past sessions on your machine. When the same error is fixed the same way in two or more of them, it keeps the fix as a one-line lesson. When the error turns up again, Claude Code is told the fix straight away, and any agent can search what earlier sessions found. How DMN keeps what agents learn.