code: 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("The following environment variables are not strings: {}".format(", ".join(non_strings)))
          else:
              return True
docs: Make sure the environment contains only strings
  
          (since putenv needs a string)