Overriding stdout in IndentPrint causes crashing
danlm opened this issue · 4 comments
Cause: When running the ui in Python 3.4, Artemis crashes when I enter "h" (for help) or try to delete a run:
CAUGHT: 'IndentPrint' object has no attribute 'errors' Traceback (most recent call last): File "demo_experiments.py", line 101, in <module> demo_linear_regression.browse(display_format="flat") File "artemis/artemis/experiments/experiments.py", line 328, in browse display_format=display_format, **kwargs) File "artemis/artemis/experiments/ui.py", line 77, in browse_experiments browser.launch(command=command) File "artemis/artemis/experiments/ui.py", line 321, in launch out = func_dict[cmd](*args) File "artemis/artemis/experiments/ui.py", line 497, in help _warn_with_prompt(self.HELP_TEXT, prompt = 'Press Enter to exit help.', use_prompt=not self.close_after) File "artemis/artemis/experiments/ui.py", line 51, in _warn_with_prompt resp = input('({}) >> '.format(prompt)) AttributeError: 'IndentPrint' object has no attribute 'errors'
I found that commenting out line 263 in artemis/general/display.py (overriding sys.stdout) gets rid of the crashes.
Hmm, I tried running demo_experiments.py
on the current master and can't reproduce this error (either by pressing h
or deleting a run). I'm in Python 3.6 but I doubt that matters. You're not working within a Jupyter notebook are you? (I guess not by the looks of your message).
Nope, I am running from .browse(). I think the version may matter: I ran the Artemis v2.0.0 on another system using Python 3.6, and I did not get this error.
Huh, so maybe it's just a Python 3.4 thing. Anyway, can you see if this: #133 fixes your issue?
No luck with the issue_fix branch - Artemis still crashes if the line is not commented out.