Have you defined folder
as a Unicode string? This affects how os.walk()
matches its subdirectories or, better, the type of return line.
>>> for a,b,c in os.walk("."): ... print b ... break ... ['DLLs', 'Doc', 'include', 'Lib', 'libs', 'tcl', 'Tools'] >>> for a,b,c in os.walk(u"."): ... print b ... break ... [u'DLLs', u'Doc', u'include', u'Lib', u'libs', u'tcl', u'Tools']
source share