code: def store_data(self, data, encoding='utf-8'):
          
          path = random_filename(self.work_path)
          try:
              with open(path, 'wb') as fh:
                  if isinstance(data, str):
                      data = data.encode(encoding)
                  if data is not None:
                      fh.write(data)
              return self.store_file(path)
          finally:
              try:
                  os.unlink(path)
              except OSError:
                  pass
docs: Put the given content into a file, possibly encoding it as UTF-8
          in the process.