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

Uncaught AttributeError in configargparse.py line 1047 #1931

Open
bitnom opened this issue Oct 5, 2024 · 7 comments
Open

Uncaught AttributeError in configargparse.py line 1047 #1931

bitnom opened this issue Oct 5, 2024 · 7 comments
Labels
bug Something isn't working fixed

Comments

@bitnom
Copy link

bitnom commented Oct 5, 2024

Aider version: 0.59.0
Python version: 3.11.9
Platform: Windows-10-10.0.19045-SP0
Python implementation: CPython
Virtual environment: No
OS: Windows 10 (64bit)
Git version: git version 2.42.0.windows.1

An uncaught exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "__main__.py", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 364, in main
    args, unknown = parser.parse_known_args(argv)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "configargparse.py", line 938, in parse_known_args
    [self.get_command_line_key_for_unknown_config_file_setting(key)],
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "configargparse.py", line 1047, in get_command_line_key_for_unknown_config_file_setting
    key_without_prefix_chars = key.strip(self.prefix_chars)
                               ^^^^^^^^^
AttributeError: 'bool' object has no attribute 'strip'

@fry69 fry69 added the bug Something isn't working label Oct 5, 2024
@lucacri
Copy link

lucacri commented Oct 5, 2024

same error for me:

Aider version: 0.59.0
Python version: 3.12.6
Platform: macOS-14.6.1-arm64-arm-64bit
Python implementation: CPython
Virtual environment: Yes
OS: Darwin 23.6.0 (64bit)
Git version: git version 2.46.0

An uncaught exception occurred:


Traceback (most recent call last):
  File "aider", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 364, in main
    args, unknown = parser.parse_known_args(argv)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "configargparse.py", line 938, in parse_known_args
    [self.get_command_line_key_for_unknown_config_file_setting(key)],
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "configargparse.py", line 1047, in get_command_line_key_for_unknown_config_file_setting
    key_without_prefix_chars = key.strip(self.prefix_chars)
                               ^^^^^^^^^
AttributeError: 'bool' object has no attribute 'strip'

I am going to check my config file to see if that's an issue.

EDIT: I checked and even removed the config file but that didn't help

@fry69
Copy link
Contributor

fry69 commented Oct 5, 2024

Thank you for filing this issue.

This might a regression due to this change -> https://aider.chat/HISTORY.html#v0590

Renamed --yes to --yes-always.

    - Now uses AIDER_YES_ALWAYS env var and yes-always: yaml key.
    - Existing YAML and .env files will need to be updated.
    - Can still abbreviate to --yes on the command line.

In any case, this exception should be handled more gracefully, so I keep the bug label.

@lucacri
Copy link

lucacri commented Oct 5, 2024

You are correct, @fry69! For anyone else: if you have multiple .aider.conf files, remember that they all extend the .aider.conf file. In my case, I had another .aider-paid.conf, and I removed the yes: true from the aider-paid.conf, but it was still setting the value in the .aider.conf.

@fry69 fry69 pinned this issue Oct 5, 2024
@andyhennie
Copy link

any workaround for this issue?

@fry69
Copy link
Contributor

fry69 commented Oct 5, 2024

any workaround for this issue?

Change

yes: true

to

yes-always: true

in all .aider.conf.yml files

Background: #767 (comment)

@fry69
Copy link
Contributor

fry69 commented Oct 5, 2024

A fix has been pushed and is available in version 0.59.1

Please update with ->

aider --update

aider will not detect the new version for up to day by itself as it caches the version.

@fry69
Copy link
Contributor

fry69 commented Oct 9, 2024

Another breaking change concerning aider.config.yml files:

Previously this worked ->

assistant-output-color: #66b8ff

Now (0.59.0+) with full YAML syntax this no longer works, # marks the hex color as a comment.
The # hex color needs to be encapsulated in quotes now ->

assistant-output-color: "#66b8ff"

@fry69 fry69 added the fixed label Oct 9, 2024
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

4 participants