'Write the PKG-INFO format data to a file object.'

def write_file(self, fileobject, skip_unknown=False):

    self.set_metadata_version()
    for field in _version2fieldlist(self[u'Metadata-Version']):
        values = self.get(field)
        if (skip_unknown and (values in (u'UNKNOWN', [], [u'UNKNOWN']))):
            continue
        if (field in _ELEMENTSFIELD):
            self._write_field(fileobject, field, u','.join(values))
            continue
        if (field not in _LISTFIELDS):
            if (field == u'Description'):
                if (self.metadata_version in (u'1.0', u'1.1')):
                    values = values.replace(u'\n', u'\n                                ')
                else:
                    values = values.replace(u'\n', u'\n                            |')
            values = [values]
        if (field in _LISTTUPLEFIELDS):
            values = [u','.join(value) for value in values]
        for value in values:
            self._write_field(fileobject, field, value)
