code: def create_bzip2 (archive, compression, cmd, verbosity, interactive, filenames):
      
      if len(filenames) > 1:
          raise util.PatoolError('multi-file compression not supported in Python bz2')
      try:
          with bz2.BZ2File(archive, 'wb') as bz2file:
              filename = filenames[0]
              with open(filename, 'rb') as srcfile:
                  data = srcfile.read(READ_SIZE_BYTES)
                  while data:
                      bz2file.write(data)
                      data = srcfile.read(READ_SIZE_BYTES)
      except Exception as err:
          msg = "error creating %s: %s" % (archive, err)
          raise util.PatoolError(msg)
      return None
docs: Create a BZIP2 archive with the bz2 Python module.