Skip to content

Uncaught KeyError in platform.py line 333 #3598

@Hakimelshabazz

Description

@Hakimelshabazz

Aider version: 0.77.1
Python version: 3.12.8
Platform: Windows-10-10.0.19045-SP0
Python implementation: CPython
Virtual environment: Yes
OS: Windows 10 (64bit)
Git version: git version 2.49.0.windows.1

An uncaught exception occurred:

Traceback (most recent call last):
  File "platform.py", line 803, in get_win32
    manufacturer, caption = _wmi_query('CPU', 'Manufacturer', 'Caption')
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "platform.py", line 327, in _wmi_query
    data = _wmi.exec_query("SELECT {} FROM {}".format(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 258] The wait operation timed out

During handling of the above exception, another 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 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 1078, in main
    coder.run()
  File "base_coder.py", line 856, in run
    self.run_one(user_message, preproc)
  File "base_coder.py", line 903, in run_one
    list(self.send_message(message))
  File "base_coder.py", line 1314, in send_message
    chunks = self.format_messages()
             ^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1219, in format_messages
    chunks = self.format_chat_chunks()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1115, in format_chat_chunks
    main_sys = self.fmt_system_prompt(self.gpt_prompts.main_system)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1075, in fmt_system_prompt
    platform_text = self.get_platform_info()
                    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "base_coder.py", line 1033, in get_platform_info
    platform_text = f"- Platform: {platform.platform()}\n"
                                   ^^^^^^^^^^^^^^^^^^^
  File "platform.py", line 1244, in platform
    system, node, release, version, machine, processor = uname()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "platform.py", line 864, in __iter__
    (self.processor,)
     ^^^^^^^^^^^^^^
  File "functools.py", line 995, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "platform.py", line 859, in processor
    return _unknown_as_blank(_Processor.get())
                             ^^^^^^^^^^^^^^^^
  File "platform.py", line 799, in get
    return func() or ''
           ^^^^^^
  File "platform.py", line 805, in get_win32
    return os.environ.get('PROCESSOR_IDENTIFIER', _get_machine_win32())
                                                  ^^^^^^^^^^^^^^^^^^^^
  File "platform.py", line 775, in _get_machine_win32
    [arch, *_] = _wmi_query('CPU', 'Architecture')
    ^^^^^^^^^^
  File "platform.py", line 333, in <genexpr>
    return (dict_data[k] for k in keys)
            ~~~~~~~~~^^^
KeyError: 'Architecture'

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