def csv_format(self, row):
if PY2:<EOL><INDENT>buf = io.BytesIO()<EOL>csvwriter = csv.writer(buf)<EOL>csvwriter.writerow([c.strip().encode(self.encoding) for c in row])<EOL>csv_line = buf.getvalue().decode(self.encoding).rstrip()<EOL><DEDENT>else:<EOL><INDENT>buf = io.StringIO()<EOL>csvwriter = csv.writer(buf)<EOL>csvwriter.writerow([c.strip() for c in row])<EOL>csv_line = buf.getvalue().rstrip()<EOL><DEDENT>return csv_line<EOL>
Converts row values into a csv line

        Args:
            row: a list of row cells as unicode
        Returns:
            csv_line (unicode)