Did you define folder
as a Unicode string? This has implications on how os.walk()
matches its subdirectories, or better, the type of string that it returns.
>>> 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']
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…