def _guessEncoding(self, path):
        if os.path.exists(path) and path.lower().endswith('csv'):
            encoding = self._detector.detect(path)

            if encoding is not None:
                if encoding.startswith('utf'):
                    encoding = encoding.replace('-', '')
                encoding = encoding.replace('-','_')

                viewValue = _encodings.get(encoding)

                self._encodingKey = encoding

                index = self._encodingComboBox.findText(viewValue.upper())
                self._encodingComboBox.setCurrentIndex(index)
Ensure the request is discarded properly.
dataset/ETHPy150Open datalyze-solutions/pandas-qt/pandasqt/views/CSVDialogs.py/CSVImportDialog._guessEncoding--crossover with--dataset/ETHPy150Open swcarpentry/amy/workshops/test/test_profile_update_request.py/TestProfileUpdateRequest.test_request_discarded