def _write(self, to_write):
        """
        Helper to call encode before writing to file for Python 3 compat.
        """
        self._file.write(to_write.encode(self._encoding or
                                         self._default_encoding))
def _write ( self , to_write ) : self . _file . write ( to_write . encode ( self . _encoding or self . _default_encoding ) )
Helper to call encode before writing to file for Python 3 compat.