You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the trace I can see that there is sometimes NSAlert modal window being displayed during startup and it is causing issue.
I also sometimes notice alert modal windows sometimes displayed during startup. It is MacOS saying that app previously did not quit cleanly and asks whether to reopen it.
Worth checking if delaying CEF initialization until after Tk windows are initialized and shown on screen (tk.mainloop must run for some time) can help resolve the issue.
It is also worth checking if maybe this issue occurs only when running from command line.
I think that our get_window_handler function may be failing when such alert modal window appears in app:
defget_window_handle(self):
ifMAC:
# Do not use self.winfo_id() on Mac, because of these issues:# 1. Window id sometimes has an invalid negative value (Issue #308).# 2. Even with valid window id it crashes during the call to NSView.setAutoresizingMask:# https://github.com/cztomczak/cefpython/issues/309#issuecomment-661094466## To fix it using PyObjC package to obtain window handle. If you change structure of windows then you# need to do modifications here as well.## There is still one issue with this solution. Sometimes there is more than one window, for example when application# didn't close cleanly last time Python displays an NSAlert window asking whether to Reopen that window. In such# case app will crash and you will see in console:# > Fatal Python error: PyEval_RestoreThread: NULL tstate# > zsh: abort python tkinter_.py# Error messages related to this: https://github.com/cztomczak/cefpython/issues/441# noinspection PyUnresolvedReferencesfromAppKitimportNSApp# noinspection PyUnresolvedReferencesimportobjclogger.info("winfo_id={}".format(self.winfo_id()))
# noinspection PyUnresolvedReferencescontent_view=objc.pyobjc_id(NSApp.windows()[-1].contentView())
logger.info("content_view={}".format(content_view))
returncontent_viewelifself.winfo_id() >0:
returnself.winfo_id()
else:
raiseException("Couldn't obtain window handle")
Thanks for creating this library, I'm currently using it in my tkinter application to have a tab that acts as an embedded web browser. It works fine on Windows however I'm experiencing these crashes on Mac.
Have their been any updates on this issue or is there a work around to be able to consistently display webpages without crashing?
Messages in console:
Getting three different crashes so far.
From the trace I can see that there is sometimes
NSAlert
modal window being displayed during startup and it is causing issue.I also sometimes notice alert modal windows sometimes displayed during startup. It is MacOS saying that app previously did not quit cleanly and asks whether to reopen it.
Worth checking if delaying CEF initialization until after Tk windows are initialized and shown on screen (tk.mainloop must run for some time) can help resolve the issue.
It is also worth checking if maybe this issue occurs only when running from command line.
I think that our
get_window_handler
function may be failing when such alert modal window appears in app:Stack trace 1:
Stack trace 2:
Stack trace 3:
Other tkinter Mac issues:
#441
#309
The text was updated successfully, but these errors were encountered: