Need some suggestions on how to go about setting up stdout and stderr so they work properly. #9407
Replies: 2 comments 12 replies
-
|
If this is for debugging purposes, why don't you just build application with console enabled, until you've sorted out the issues? And only then switch to noconsole/windowed. If you launch the windowed/noconsole executable from command-prompt and redirect output to a file (in the shell, e.g., |
Beta Was this translation helpful? Give feedback.
12 replies
-
|
Here's a link discussing stdout redirection including C-level streams https://eli.thegreenplace.net/2015/redirecting-all-kinds-of-stdout-in-python/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have an application I am developing and there are quit a few C extension modules in it and those extension modules do attach to the input and output streams. I am running into a bump in the road where errors that occur are not being forwarded because those streams don't exist. Even if I create new streams and set them to stdout and stderr in the sys module it doesn't function properly.
My issue is my application is getting stuck and I am not able to tell where it is getting stuck. It only gets stuck when it is compiled as an executable. When I have not compiled it the script runs without any issues. I don't see anywhere in pyinstaller where I am able to have it build the debugging files when it builds my executable. Perhaps I missed it when I was looking over the documentation...
This is what I am doing currently is I am wrapping sys.stdout and sys.stderr in classes that use
io.TextIOWrapperas a parent class and I am simply dropping the instances into sys. While this works properly without compiling it doesn't once compiled and I am not getting all of the information I should be getting.Beta Was this translation helpful? Give feedback.
All reactions