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
[BUG] AttributeError
using Console.capture
when run with pythonw
#2400
Comments
I don't have a Windows box handy. What happens if you run a script with pythonw that does |
Hi Will. There is no output. I somewhat expected this as I believe |
And is that the behaviour you would expect from Rich? To silently ignore the error? Could you paste the full traceback? |
To frame my expected behaviour in a slightly alternative manner:
Directly answering your question though: yes, I believe there should be no error. The traceback above is complete except for my calling code, which is no different from the example given. |
I see. So the error occurs regardless of if you are printing to stdout or not. You didn't include the full traceback btw. The error message would help. |
Yes, the error is occurring despite no intent to print to Sorry, you're absolutely right: I did fail to paste the actual error message. I've edited that in to the earlier message now, but here's the entire thing from my logging anyway for good measure, in case any of the other bits do actually help:
In particular, |
Did I solve your problem? Why not buy the devs a coffee to say thanks? |
Describe the bug
This code, when run using
pythonw
:fails with this stack trace:
My guess is that
pythonw
causesConsole
to get some attributes that are usually not null, but in this case, are.I can probably immediately work around this by instantiating the
Console
like so:but Rich could probably cater for the
Console
instance having noSTDOUT
in some cases (such as above).Platform
I've avoided including details generated by
python -m rich.diagnose
because more diagnostic information would be provided usingpythonw ...
—but of course, since it disablesSTDOUT
, there's no obvious way to grab that info for you. 🤣The text was updated successfully, but these errors were encountered: