Bug 15675 - qemurunner: format_exception() missing 2 required positional arguments
Summary: qemurunner: format_exception() missing 2 required positional arguments
Status: RESOLVED FIXED
Alias: None
Product: Runtime Testing
Classification: QA/Testing
Component: oeqa/runtime (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 5.2 M2
Assignee: Mathieu Dubois-Briand
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2024-11-28 14:59 UTC by Mathieu Dubois-Briand
Modified: 2025-01-15 10:27 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Dubois-Briand 2024-11-28 14:59:43 UTC
LoggingThread exception handler fails to handle exceptions properly, with the following exception:

>   File "/srv/pokybuild/yocto-worker/qemux86-64-tc/build/meta/lib/oeqa/utils/qemurunner.py", line 750, in threadtarget
>     self.logger.warning("Exception %s in logging thread" % traceback.format_exception(e))
> TypeError: format_exception() missing 2 required positional arguments: 'value' and 'tb'

https://valkyrie.yoctoproject.org/#/builders/66/builds/529/steps/12/logs/stdio

I believe this is because python 3.8 was used here, and this syntax for traceback.format_exception() is only supported since 3.10.

https://docs.python.org/3/library/traceback.html#traceback.format_exception

> Since Python 3.10, instead of passing value and tb, an exception object can be passed as the first argument. If value and tb are provided, the first argument is ignored in order to provide backwards compatibility.

We will have to switch to the old syntax if we want to be compatible with python versions before 3.10.
Comment 1 Mathieu Dubois-Briand 2024-11-28 15:05:30 UTC
qemux86-64-tc ubuntu2004-vk-2 master-next completed at 2024-11-27T12:15:38Z
https://valkyrie.yoctoproject.org/#/builders/66/builds/529/steps/12/logs/stdio
Comment 2 Mathieu Dubois-Briand 2025-01-15 10:27:35 UTC
Fixed by 5f9ecf5f210e qemurunner: Fix stack trace generation in exception handler