13 lines
675 B
Markdown
13 lines
675 B
Markdown
# MCP Tools Bug Fix - newline parameter
|
|
|
|
## Issue
|
|
The MCP edit_file tool in `src/mcp_client.py` was using `newline=""` in `read_text()` and `write_text()` calls. This parameter is NOT supported by Python's `pathlib.Path` methods before Python 3.10.
|
|
|
|
## Fix Applied
|
|
Removed all `newline=""` parameters from:
|
|
- `p.read_text(encoding="utf-8", newline="")` → `p.read_text(encoding="utf-8")`
|
|
- `p.write_text(content, encoding="utf-8", newline="")` → `p.write_text(content, encoding="utf-8")`
|
|
|
|
## Prevention
|
|
When editing Python files via MCP tools, always use the standard `encoding="utf-8"` without the `newline` parameter, as Python's pathlib doesn't support it until 3.10+.
|