Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When aider tries to create *.py file it throws OSError on Windows #603

Closed
VictorBargains opened this issue May 15, 2024 · 4 comments
Closed
Labels
bug Something isn't working fixed

Comments

@VictorBargains
Copy link

VictorBargains commented May 15, 2024

Issue

> /add *.py

No files matched '*.py'. Do you want to create
C:\Users\victorb\code\multiverse\autogen_skyseer\colab_gpt4o\02_src\*.py? yes
Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\victorb\code\multiverse\autogen_skyseer\colab_gpt4o\02_src\.venv\Scripts\aider.exe\__main__.py", line 7, in <module>
    sys.exit(main())
  File "C:\Users\victorb\code\multiverse\autogen_skyseer\colab_gpt4o\02_src\.venv\lib\site-packages\aider\main.py", line 408, in main
    coder.run()
  File "C:\Users\victorb\code\multiverse\autogen_skyseer\colab_gpt4o\02_src\.venv\lib\site-packages\aider\coders\base_coder.py", line 496, in run
    new_user_message = self.run_loop()
  File "C:\Users\victorb\code\multiverse\autogen_skyseer\colab_gpt4o\02_src\.venv\lib\site-packages\aider\coders\base_coder.py", line 523, in run_loop
    return self.commands.run(inp)
  File "C:\Users\victorb\code\multiverse\autogen_skyseer\colab_gpt4o\02_src\.venv\lib\site-packages\aider\commands.py", line 131, in run
    return self.do_run(matching_commands[0][1:], rest_inp)
  File "C:\Users\victorb\code\multiverse\autogen_skyseer\colab_gpt4o\02_src\.venv\lib\site-packages\aider\commands.py", line 105, in do_run
    return cmd_method(args)
  File "C:\Users\victorb\code\multiverse\autogen_skyseer\colab_gpt4o\02_src\.venv\lib\site-packages\aider\commands.py", line 397, in cmd_add
    fname.touch()
  File "C:\Python310\lib\pathlib.py", line 1166, in touch
    self._accessor.touch(self, mode, exist_ok)
  File "C:\Python310\lib\pathlib.py", line 331, in touch
    fd = os.open(path, flags, mode)
OSError: [Errno 22] Invalid argument: 'C:\\Users\\victorb\\code\\multiverse\\autogen_skyseer\\colab_gpt4o\\02_src\\*.py'


### Version and model info

$ aider --model gpt-4o --yes backend
Aider v0.35.0
Model: gpt-4o with diff edit format
Git repo: .git with 11 files
Repo-map: using 1024 tokens
VSCode terminal detected, pretty output has been disabled.
Use /help to see in-chat commands, run with --help to see cmd line args
────────────────────────────────────────────────────────────────────────────────────────────────────
@paul-gauthier paul-gauthier added the question Further information is requested label May 16, 2024
@paul-gauthier
Copy link
Owner

Thanks for trying aider and filing this issue.

When you run with --yes aider will answer yes to every question. Sometimes that will cause unexpected actions to occur.

What are you trying to do? Why are you running with --yes and then typing /add *.py when there are no python files?

@VictorBargains
Copy link
Author

VictorBargains commented May 16, 2024 via email

@paul-gauthier
Copy link
Owner

Ah yes, you're right. Aider should catch the OSError.

FYI, on non-Windows, you can make files with wildcards in their names.

@paul-gauthier paul-gauthier added bug Something isn't working and removed question Further information is requested labels May 16, 2024
@paul-gauthier paul-gauthier changed the title aider --yes tries to create *.py file aider --yes tries to create *.py file, which throws OSError on Windows May 16, 2024
@paul-gauthier paul-gauthier changed the title aider --yes tries to create *.py file, which throws OSError on Windows When aider tries to create *.py file it throws OSError on Windows May 16, 2024
@paul-gauthier
Copy link
Owner

Aider fixed this issue. The change is available in the main branch. You can get it by installing the latest version from github:

python -m pip install --upgrade git+https://github.com/paul-gauthier/aider.git

If you have a chance to try it, let me know if it works better for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

2 participants