'Attempt to set the attribute to the value, with a pretty try
block around it.'

def TrySetAttribute(self, attribute, value):

    if (attribute == 'loc'):
        self.loc = self.Canonicalize(value)
    else:
        try:
            setattr(self, attribute, value)
        except AttributeError:
            output.Warn(('Unknown    URL    attribute:    %s' % attribute))
