Write tool fails with EEXIST error on paths containing non-ASCII (Japanese) characters on Windows
Resolved 💬 5 comments Opened Mar 5, 2026 by ktoshio7 Closed Apr 3, 2026
Bug Description
The Write tool fails with an EEXIST error when the file path contains non-ASCII characters (specifically Japanese characters). This was working previously and appears to be a regression.
Error Message
EEXIST: file already exists, mkdir 'D:\日本語パス\project'
Steps to Reproduce
- Have an existing directory with Japanese characters in the path (e.g.,
D:\日本語パス\project\) - Use the Write tool to create a new file in that directory:
file_path:D:/日本語パス/project/write_test.txtcontent: any text content
- The tool fails with the EEXIST error
Expected Behavior
The file should be created successfully, as it was working before.
Actual Behavior
The Write tool throws EEXIST: file already exists, mkdir 'D:\日本語パス\project' and fails to create the file.
Additional Context
- Platform: Windows 11 Home 10.0.26200
- Shell: bash
- Writing to a path without Japanese characters (e.g.,
D:/newfile/write_test.txt) works fine - Using Bash tool with
printf > "D:/日本語パス/project/write_test.txt"as a workaround also works fine - The Read tool works correctly with the same Japanese path
- The issue appears to be in the
fs.mkdircall within the Write tool's directory creation logic — therecursive: trueoption may not be functioning correctly for non-ASCII paths on Windows
Workaround
Use the Bash tool to write files to paths containing non-ASCII characters instead of the Write tool.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗