code: def tarFile(source):
      
      # source = source.decode('UTF-8')
      target = source[0:source.rindex('.')] + '.tar.gz'
  
      try:
          with tarfile.open(target, "w:gz") as tar_file:
              tar_file.add(source, arcname=source[source.startswith("/"):])
              __cps_rate__(source, target)
      except IOError as e:
          logger.error('Compress file[%s] with zip mode failed. Case: %s', source, str(e))
          target = source
  
      return target
docs: Compress file under tar mode
          which type more popular use in Unix operating system
          when compress failed with return source path
      :param source: source file path
      :return: zip file path