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

dependency on capturer #135

Open
fbergmann opened this issue May 3, 2023 · 2 comments · May be fixed by #137 or #138
Open

dependency on capturer #135

fbergmann opened this issue May 3, 2023 · 2 comments · May be fixed by #137 or #138

Comments

@fbergmann
Copy link

I'm having the problem in the COPASI biosimulators package, that the simulator hangs (on macOS) immediately as long as logging is enabled. I've narrowed this down to the capturer module being used by the utils package, unfortunately even the simple test file:

import subprocess
from capturer import CaptureOutput

with CaptureOutput() as capturer:
    # Generate some output from Python.
    print ("Output from Python")
    # Generate output from a subprocess.
    subprocess.call(["echo", "Output from a subprocess"])
    # Get the output in each of the supported formats.
    assert (capturer.get_bytes() == b'Output from Python\r\nOutput from a subprocess\r\n')
    assert (capturer.get_lines() == [u'Output from Python', u'Output from a subprocess'])
    assert (capturer.get_text() == u'Output from Python\nOutput from a subprocess')

freezes the application immediately. Unfortunately with logging disabled, the application does not actually process the model. I've verified this with python 3.11 and python 3.9.

@AlexPatrie
Copy link
Contributor

I have been experiencing the same issue. I am currently working on the implementation of a method that overrides this disabled logging such that the capture does not depend on config.LOG.

@AlexPatrie
Copy link
Contributor

As I run your test script through the VS Code debugger, the error: TypeError: cannot pickle '_io.BufferedReader' object is exposed. Interesting as this error never "makes it's way to the surface" to the user when executed from cli as normal. See a proposed WIP solution here: #134.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment