Skip to content

Uncaught OSError in pathlib.py line 840 #69

@devsoft-co-za

Description

@devsoft-co-za

Issue

aider --model deepseek/deepseek-reasoner --editor-model deepseek/deepseek-chat --disable-playwright --yes-always
────────────────────────────────────────────────────────────────────────────────────────────────────────────────

# Uncaught OSError in pathlib.py line 840

Aider version: 0.83.1
Python version: 3.12.8
Platform: Linux-6.16.8-1-MANJARO-x86_64-with-glibc2.42
Python implementation: CPython
Virtual environment: Yes
OS: Linux 6.16.8-1-MANJARO (64bit)
Git version: git version 2.51.0

An uncaught exception occurred:

Traceback (most recent call last):
File "aider", line 10, in
sys.exit(main())
^^^^^^
File "main.py", line 699, in main
if Path(all_files[0]).is_dir():
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pathlib.py", line 875, in is_dir
return S_ISDIR(self.stat().st_mode)
^^^^^^^^^^^
File "pathlib.py", line 840, in stat
return os.stat(self, follow_symlinks=follow_symlinks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 36] File name too long: '--mcp-servers={\n "mcpServers": {\n "context7": {\n "type": "stdio",\n "command": "npx",\n "args": [\n "-y",\n "@upstash/context7-mcp"\n ],\n "env": {\n "DEFAULT_MINIMUM_TOKENS": "6000"\n },\n "autoApprove": [\n "resolve-library-id",\n "get-library-docs"\n ],\n "alwaysAllow": [\n "resolve-library-id",\n "get-library-docs"\n ]\n }\n }\n}\n'


Please consider reporting this bug to help improve aider!
Open a GitHub Issue pre-filled with the above error in your browser? (Y/n) n
Traceback (most recent call last):
  File "/home/tom/.local/bin/aider", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/tom/.local/share/uv/tools/aider-chat/lib/python3.12/site-packages/aider/main.py", line 699, in main
    if Path(all_files[0]).is_dir():
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/tom/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/python3.12/pathlib.py", line 875, in is_dir
    return S_ISDIR(self.stat().st_mode)
                   ^^^^^^^^^^^
  File "/home/tom/.local/share/uv/python/cpython-3.12.8-linux-x86_64-gnu/lib/python3.12/pathlib.py", line 840, in stat
    return os.stat(self, follow_symlinks=follow_symlinks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 36] File name too long: '--mcp-servers={\n  "mcpServers": {\n    "context7": {\n          "type": "stdio",\n          "command": "npx",\n          "args": [\n              "-y",\n              "@upstash/context7-mcp"\n          ],\n          "env": {\n              "DEFAULT_MINIMUM_TOKENS": "6000"\n          },\n          "autoApprove": [\n              "resolve-library-id",\n              "get-library-docs"\n          ],\n          "alwaysAllow": [\n              "resolve-library-id",\n              "get-library-docs"\n          ]\n      }\n  }\n}\n'

Version and model info

Aider 83.1
Python 3.12

aider.conf.yml:

cache-prompts: true
dark-mode: true
light-mode: false
auto-commits: true

mcp-servers: |
  {
    "mcpServers": {
      "context7": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@upstash/context7-mcp"
            ],
            "env": {
                "DEFAULT_MINIMUM_TOKENS": "6000"
            },
            "autoApprove": [
                "resolve-library-id",
                "get-library-docs"
            ],
            "alwaysAllow": [
                "resolve-library-id",
                "get-library-docs"
            ]
        }
    }
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions