pyomo icon indicating copy to clipboard operation
pyomo copied to clipboard

Capture Highs output when solving

Open Coloquinte opened this issue 1 year ago • 0 comments

Summary

Highs logs are not entirely captured. As discussed on the Highs bug tracker, it can result in error messages like the following: ERROR: Output stream (<_io.TextIOWrapper name='' mode='w' encoding='utf-8'>) closed before all output was written to it. The following was left in the output buffer: 'ERROR: Output stream (<_io.TextIOWrapper name='' mode='w'\nencoding='utf-8'>). The expected behaviour is that no error message and no log line is written.

Logs in Highs may be written by any function, including addRows. I think the reason for this issue is that they are not covered by TeeStream. This is related to #3003.

Steps to reproduce the issue

Run the hangs.py file from this repository on Windows

Error Message

Multiple lines like ERROR: Output stream (<_io.TextIOWrapper name='' mode='w' encoding='utf-8'>) closed before all output was written to it. The following was left in the output buffer: 'ERROR: Output stream (<_io.TextIOWrapper name='' mode='w'\nencoding='utf-8'>)

Information on your system

Pyomo version: 6.7 Python version: 3.11 Operating system: Windows How Pyomo was installed (PyPI, conda, source): pip Solver (if applicable): Highspy

Additional information

Coloquinte avatar Mar 25 '24 18:03 Coloquinte