'Make sure the environment contains only strings
(since putenv needs a string)'

def check_environment(self, environment):

    non_strings = []
    for (k, v) in environment.items():
        if (not isinstance(v, basestring)):
            non_strings.append(k)
    if non_strings:
        raise ValueError(u'The    following    environment    variables    are    not    strings:    {}'.format(u',    '.join(non_strings)))
    else:
        return True
