'Creating a profile instance like p = profile() is done in order to be
able to create a new profile from scratch and then call
save(profname).
When reading a profile, you should use p = profile(profname).'

def __init__(self, profname='', workdir=None):

    optionxform = (lambda opt: opt)
    self._config = ConfigParser.ConfigParser()
    self._config.optionxform = optionxform
    if profname:
        profname = self.get_real_profile_path(profname, workdir)
        with codecs.open(profname, 'rb', UTF8) as fp:
            try:
                self._config.readfp(fp)
            except ConfigParser.Error as cpe:
                msg = 'ConfigParser    error    in    profile:    "%s".    Exception:    "%s"'
                raise BaseFrameworkException((msg % (profname, cpe)))
            except Exception as e:
                msg = 'Unknown    error    in    profile:    "%s".    Exception:    "%s"'
                raise BaseFrameworkException((msg % (profname, e)))
            else:
                if (not self.get_name()):
                    msg = 'The    profile    with    name    "%s"    does    NOT    contain    a    [profile]    section    with    the    "name"    attribute.'
                    raise BaseFrameworkException((msg % (profname,)))
    self.profile_file_name = profname
