'Modified to pass the filename to the FileDataToken'

def set_token(self, token_path):

    for (key, val, ipath, setter) in self.iter_setters():
        if (ipath == token_path):
            if isinstance(val, (DataToken, FileDataToken)):
                token = val
            elif (key in self.get_file_vars()):
                fname = (val.filename if hasattr(val, 'filename') else None)
                token = FileDataToken(key, val, fname, ipath)
            else:
                token = DataToken(key, val, ipath)
            setter(token)
            self.token = token
            return token
