set topdown=False inside os.walk., at least till you replace it with scandir (which looks pretty neat, might steal that idea)