What happened:
When executing the run_python action, an unhandled internal exception is thrown: AttributeError: 'NoneType' object has no attribute 'flush'. The action fails completely, does not return execution results, and aborts the running task. This error occurs during stdout/stderr stream handling after Python code execution completes.
What I expected:
The run_python action should execute the provided Python code successfully, capture all output correctly, and return exit code / stdout / stderr results cleanly. Even when user provided code contains errors, the action should handle it gracefully and return the error output instead of crashing with an internal agent exception.
Steps to reproduce:
- Call the run_python action with any valid or invalid Python code snippet
- Observe the internal AttributeError is thrown instead of execution results
- Error occurs 100% consistently on all run_python invocations
Environment:
OS: Windows 11
Container OS: Linux 6.12.13
Logs:
AttributeError: 'NoneType' object has no attribute 'flush'
Consider referring to this similar issue: huggingface/diffusers#3290
What happened:
When executing the run_python action, an unhandled internal exception is thrown: AttributeError: 'NoneType' object has no attribute 'flush'. The action fails completely, does not return execution results, and aborts the running task. This error occurs during stdout/stderr stream handling after Python code execution completes.
What I expected:
The run_python action should execute the provided Python code successfully, capture all output correctly, and return exit code / stdout / stderr results cleanly. Even when user provided code contains errors, the action should handle it gracefully and return the error output instead of crashing with an internal agent exception.
Steps to reproduce:
Environment:
OS: Windows 11
Container OS: Linux 6.12.13
Logs:
AttributeError: 'NoneType' object has no attribute 'flush'Consider referring to this similar issue: huggingface/diffusers#3290