Bug: QApplication() raise nothing on tty

Florian Bruhin me at the-compiler.org
Mon Jul 17 23:08:51 BST 2023


Hey,

> as a real world example please let me show you how much work and action
> is done in my team just to workaround that problem.
> 
> Please see this function [1] and the magic behind [2]. There we
> figuring out if Qt is available or not because our application is able
> to run on tty and on X/Wayland.
> 
> For more context please visit the related PR [3].
> 
> Thanks for your time.

Right - I'm not saying it's not a problem. But it's not a PyQt bug.

This is something Qt would need to fix (by providing *some* way to check
whether a QApplication + GUI is available without crashing when it's
not), but looking at the relevant issues in the Qt tracker, that doesn't
seem to be happening:

https://bugreports.qt.io/browse/QTBUG-106192
https://bugreports.qt.io/browse/QTBUG-63763

The fact that Qt aborts the process is a Qt problem, not a PyQt one.
There's simply no way PyQt can do anything different here.

Also see a similar consideration in PySide around creating a widget
without a QApplication: https://bugreports.qt.io/browse/PYSIDE-1451
Same story there: Python crashes because Qt does, and there's no way for
that to be changed from a Python wrapper.

I'll disengage from this conversation at this point, as I feel as I'm
just repeating myself and we're going in circles.

Florian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230718/961eca97/attachment.sig>


More information about the PyQt mailing list