def write_file(self, fileobject, skip_unknown=False):
self.set_metadata_version()<EOL>for field in _version2fieldlist(self['<STR_LIT>']):<EOL><INDENT>values = self.get(field)<EOL>if skip_unknown and values in ('<STR_LIT>', [], ['<STR_LIT>']):<EOL><INDENT>continue<EOL><DEDENT>if field in _ELEMENTSFIELD:<EOL><INDENT>self._write_field(fileobject, field, '<STR_LIT:U+002C>'.join(values))<EOL>continue<EOL><DEDENT>if field not in _LISTFIELDS:<EOL><INDENT>if field == '<STR_LIT>':<EOL><INDENT>if self.metadata_version in ('<STR_LIT:1.0>', '<STR_LIT>'):<EOL><INDENT>values = values.replace('<STR_LIT:\n>', '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>values = values.replace('<STR_LIT:\n>', '<STR_LIT>')<EOL><DEDENT><DEDENT>values = [values]<EOL><DEDENT>if field in _LISTTUPLEFIELDS:<EOL><INDENT>values = ['<STR_LIT:U+002C>'.join(value) for value in values]<EOL><DEDENT>for value in values:<EOL><INDENT>self._write_field(fileobject, field, value)<EOL><DEDENT><DEDENT>
Write the PKG-INFO format data to a file object.