code: def get_header_description(filedata):
      
      python_version = sys.version_info.major
      if python_version == 3:
          filedata = Parser().parsestr(filedata)
      else:
          filedata = Parser().parsestr(filedata.encode("UTF-8", "replace"))
  
      payload = filedata.get_payload()
      lines = payload.split('\n')
      while True:
          if lines and lines[-1] == '':
              lines.pop()
          else:
              break
      return '\n'.join(lines)
docs: Get description from metadata file and remove any empty lines at end.