Disclaimer: I have no real clue about Python & gdb's pretty printer internals, so far only at outer shell of problem.
On CI KDevelop's GDB pretty printer units tests fail, but not locally for me (same for others). At least not out-of-the-box. Only looking at situation with openSUSE for a start here (fails on BSD & Windows on CI as well, but perhaps for other reasons, also cannot compare).
The error message hints to some encoding problem, compare e.g. the first error from Python being forwarded to be
`"$1 = Python Exception <class 'UnicodeEncodeError'> 'ascii' codec can't encode characters in position 4-13: ordinal not in range(128): \n"`
[[https://build.kde.org/view/KDevelop/job/KDevelop%20kdevelop%20kf5-qt5%20SUSEQt5.9/309/testReport/(root)/TestSuite/test_gdbprinters/ | (see complete test result)]]
By the string positions and my intermediate understanding of the code, some Python code fails over the Chinese(?) chars in the string in https://phabricator.kde.org/source/kdevelop/browse/master/plugins/debuggercommon/tests/debuggees/qstring.cpp$4 when it tries to format this for output to the gdb log (not exactly sure, but so far working theory).
Locally I could reproduce that error by setting both the env variables `LANG` and `LC_CTYPE` tp `C` (which normally are `LANG=de_DE.UTF-8` and `LC_CTYPE=de_DE.UTF-8`).
The failing tests could be also reproduced by @pprkut by just setting `LANG` to `C` (whose system has `LC_CTYPE` as empty string).
Which for now opens the questions what the respective env vars on CI are, and if perhaps they might need some fix-up to have UTF.8 system encoding promoted as needed. Or if there is some other Python settings which influence things and which might need adapton.
So far my braindump here, hoping that you @bcooksley might already give some helping feedback :)