Did you try
next(os.walk(directory))
In the doc, it seems that os.walk only works with strings (unicode), so that you shouldn't have encoding/decoding issues.
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691