-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Panic when using Windows GUI app #5690
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
Comments
optional stdio issue may be related |
It seems that it is possible to re-enable the console for windows when performing use windows::Win32::System::Console::{AttachConsole, ATTACH_PARENT_PROCESS};
let _ = unsafe { AttachConsole(ATTACH_PARENT_PROCESS) }; But unfortunately, this doesn't seem to fix the panic issue. So I created this PR: I also tried to just disable std::err and std::in, but this somehow didn't work and caused the same error. |
There was also #5420. @arihant2math @coolreader18 we seem to merge one of them, right? Could you help for decision and reviews? |
I was searching through, since I remember using
The error message is Also the example tauri application seems to be working for me. |
In my opinion #5691 is slightly cleaner, but both should be essentially equivalent. |
Uh oh!
There was an error while loading. Please reload this page.
Summary
I tried to use RustPython in a windows GUI app, so that python code is running in the background and the result is displayed in a GUI. Unfortunately, it seems that stdin/stdout is required. I get a
essential initialization failed
panic errorI also have a sample tauri application here that can replicate the issue:
https://github.com/marcomq/tauri-plugin-python/tree/main/examples/plain-javascript
The gui is preventing the console with
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
I could also uncomment this line, but this would then always show a console in the background of the windows app, which is kind of a very ugly workaround.
I will check if I can maybe fix it locally, but I just wanted to create this issue first for documentation.
Expected
It would be nice if it wouldn't be required to have a console, similar to wasm/wasi mode.
Actual
The issue can only be replicated on windows release without console, so there is probably no real error visible and the application just doesn't start up.
Python Documentation
The text was updated successfully, but these errors were encountered: