Re: [PATCH] selftests: tc-testing: fix list_categories() crash on list type

From
Naveen A <hidden>
Date
2026-03-04 02:34:30
Also in
linux-kselftest, lkml
Reply to
Jakub Kicinski, 2026-03-04
How did you find this issue? I can't figure out what's calling this
function in the first place.
I encountered this while running the tc-testing selftests locally.

The script raised the error:

TypeError: unhashable type: 'list'

The traceback pointed to list_categories(), where a set(map(...))
was being created from the 'category' field.

Since 'category' is a list in the test cases, Python attempts to
insert the list itself into the set, which raises the unhashable
type error. After tracing this, I updated the logic to flatten the
category lists and collect unique category names using set.update().


On Wed, 4 Mar 2026 at 07:47, Jakub Kicinski [off-list ref] wrote:
On Sat, 28 Feb 2026 13:17:35 +0530 mr.navi8680@gmail.com wrote:
quoted
list_categories() builds a set directly from the 'category'
field of each test case. Since 'category' is a list,
set(map(...)) attempts to insert lists into a set, which
raises:

  TypeError: unhashable type: 'list'

Flatten category lists and collect unique category names
using set.update() instead.
How did you find this issue?

I can't figure out what's calling this function in the first place.
--
pw-bot: cr
Thread (6 messages) 6 messages, 3 authors, last reply 2026-03-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help