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

AttributeError: 'wrapper_descriptor' object has no attribute '__code__' when attempting to use a custom language #1279

Open
andrewmbenton opened this issue May 23, 2024 · 1 comment

Comments

@andrewmbenton
Copy link

Describe the bug

Attempted to create a custom language like in https://docs.openinterpreter.com/code-execution/custom-languages but Python complains that AttributeError: 'wrapper_descriptor' object has no attribute '__code__' with the last line of the stack trace. Location is:

  File "/usr/local/lib/python3.12/site-packages/interpreter/core/computer/terminal/terminal.py", line 83, in _streaming_run
    if lang_class.__init__.__code__.co_argcount > 1:

Reproduce

  1. Create a Python program that attempts to use a custom language class like the one defined in https://docs.openinterpreter.com/code-execution/custom-languages
  2. Run it

Expected behavior

The program should run

Screenshots

No response

Open Interpreter version

0.2.5

Python version

3.12.3

Operating System name and version

Docker container with uname -a as Linux computer 6.8.0-76060800daily20240311-generic #202403110203171407766522.044c8e9a0dev-Ubuntu SMP PREEMPT_DY x86_64 GNU/Linux

Additional context

No response

@andrewmbenton
Copy link
Author

I was able to work around this by adding an explicit constructor in my custom language class, e.g.:

class CustomPython:
    def __init__(self):
        super().__init__()

But it seems like there's probably a way to fix the underlying issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant