parameters: (self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape")
docstring: Return a tar header as a string of 512 byte blocks.
docstring_summary: Return a tar header as a string of 512 byte blocks.
docstring_tokens: Return a tar header as a string of 512 byte blocks .
function: def tobuf(self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape"):
          """Return a tar header as a string of 512 byte blocks.
          """
          info = self.get_info()
  
          if format == USTAR_FORMAT:
              return self.create_ustar_header(info, encoding, errors)
          elif format == GNU_FORMAT:
              return self.create_gnu_header(info, encoding, errors)
          elif format == PAX_FORMAT:
              return self.create_pax_header(info, encoding)
          else:
              raise ValueError("invalid format")
function_tokens: def tobuf ( self , format = DEFAULT_FORMAT , encoding = ENCODING , errors = "surrogateescape" ) : info = self . get_info ( ) if format == USTAR_FORMAT : return self . create_ustar_header ( info , encoding , errors ) elif format == GNU_FORMAT : return self . create_gnu_header ( info , encoding , errors ) elif format == PAX_FORMAT : return self . create_pax_header ( info , encoding ) else : raise ValueError ( "invalid format" )