def on_open_failed(self, path, encoding):
        self.enable_caret_line(False)
        self.ui.comboBoxEncodings.current_encoding = encoding
        self.ui.lblDescription.setText(
            self._description % (_('There was a problem opening the file %r') %
                                 path))
        # load text as binary and mark it as red, user might make use the
        # binary to recognize the original encoding
        try:
            with open(path, 'rb') as file:
                content = str(file.read(16))
        except __HOLE__:
            content = ''
        # set plain text
        self.editor.setPlainText(
            content, self.editor.file.get_mimetype(path),
            self.editor.file.encoding)
        self.editor.setDocumentTitle(self.editor.file.name)
        self.editor.setWindowTitle(self.editor.file.name)

        # Delay because the editor might not have been shown yet
        QtCore.QTimer.singleShot(1, self.show)
dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/pyqode/core/panels/encodings.py/EncodingPanel.on_open_failed