ensure proper typing of path, cause py3 listdir
ensure proper typing of path, cause py3 listdir

since now output is based on input, we need to make sure its always same
fixes #25856

thaim/ansible,thaim/ansible