Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

IPython Qt incorrect string formatting in raised error

Open
#1,583 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
58/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start with src/debugpy/_vendored/pydevd/pydev_ipython/qt.py lines 15-17 and inspect the RuntimeError format string alongside its arguments. Reproduce the reported Qt API error if possible, then verify that the invalid-API path raises the intended RuntimeError rather than a TypeError.

Written by the indexing model from the issue text.

Description

bug
Issue

I'm getting a Failed to enable GUI event loop integration for 'qt' error when attempting to debug a PyQt application (I've seen the guiEventLoop parameter discussed elsewhere, but I can't find anything about what it actually does. Can anyone explain it?). However, the full traceback for the error seems to point to an additional bug in debugpy concerning these lines:

Abridged traceback:

  File "c:\Users\Andrew\.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\qt.py", line 16, in <module>
    raise RuntimeError("Invalid Qt API %r, valid values are: %r, %r" %
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: not all arguments converted during string formatting

Problematic lines:
https://github.com/microsoft/debugpy/blob/09b5af0bb730e2707ec3bbc14c509523eca116c0/src/debugpy/_vendored/pydevd/pydev_ipython/qt.py#L15-L17

Full traceback

Failed to enable GUI event loop integration for 'qt'
Traceback (most recent call last):
  File "c:\Users\Andrew\.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\matplotlibtools.py", line 30, in do_enable_gui
    enable_gui(guiname)
  File "c:\Users\Andrew\.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\inputhook.py", line 540, in enable_gui
    return gui_hook(app)
           ^^^^^^^^^^^^^
  File "c:\Users\Andrew\.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\inputhook.py", line 176, in enable_qt
    from pydev_ipython.qt_for_kernel import QT_API, QT_API_PYQT5
  File "c:\Users\Andrew\.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\qt_for_kernel.py", line 119, in <module>
    from pydev_ipython.qt import QtCore, QtGui, QtSvg, QT_API
  File "c:\Users\Andrew\.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\_vendored\pydevd\pydev_ipython\qt.py", line 16, in <module>
    raise RuntimeError("Invalid Qt API %r, valid values are: %r, %r" %
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: not all arguments converted during string formatting
Backend QtAgg is interactive backend. Turning interactive mode on.

Software Versions
  • Python: 3.12.2
  • VS Code Python extension: v2024.7.11311010 (pre-release)
  • VS Code Python Debugger extension: v2024.6.0
  • PyQt6: 6.6.1
Dominant language
Python
Stars
2.5k
Forks
202
Avg merge
5d 1h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/debugpy

All issues in microsoft/debugpy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.