Skip to content

back to SWE-Agent summary

SWE-Agent: chardet

Pytest Summary for test .

status count
failed 375
passed 1
xfailed 7
total 383
collected 383

Failed pytests:

_ude_4.txt-iso-8859-1]

_ude_4.txt-iso-8859-1]
file_name = 'tests/iso-8859-1/_ude_4.txt', encoding = 'iso-8859-1'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b"Il padre. Ecco, sissignore! Ma un fatto \xe8 come un sacco: vuoto, non si regge. Perch\xe9 si regga, bisog...ntre quella poverina\ncredeva di sacrificarsi per me e per quei due, cucendo anche di notte la roba di Madama Pace!\n")
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_6.txt-iso-8859-1]

_ude_6.txt-iso-8859-1]
file_name = 'tests/iso-8859-1/_ude_6.txt', encoding = 'iso-8859-1'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'Viel\xe4 ehdit perehty\xe4 Sibeliuksen el\xe4m\xe4\xe4n Ateneumissa, aina 22. maaliskuuta asti.\nMoniaisti...in ja paahtimoihin.\nTapahtumassa kilpaillaan lis\xe4ksi Cup Tasting, Brewers Cup ja Vuoden Barista titteleist\xe4.\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_2.txt-iso-8859-1]

_ude_2.txt-iso-8859-1]
file_name = 'tests/iso-8859-1/_ude_2.txt', encoding = 'iso-8859-1'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'Le type de visa requis pour entrer en France d\xe9pend \xe0 la fois de la dur\xe9e et des motifs du s\xe9j...urn\xe9e, sportifs disputant un championnat, salari\xe9 d\xe9tach\xe9 dans le cadre d\'une\nprestation de service).\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_5.txt-iso-8859-1]

_ude_5.txt-iso-8859-1]
file_name = 'tests/iso-8859-1/_ude_5.txt', encoding = 'iso-8859-1'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'Agentes de la Guardia Civil de la Comandancia de Madrid, integrantes del Equipo Mujer Menor, han detenido ...clases a Alumnos de Primaria,\nera tutor de ni\xf1os de 11 a\xf1os, pero daba clases a otros menores de 13 a\xf1os.\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_3.txt-iso-8859-1]

_ude_3.txt-iso-8859-1]
file_name = 'tests/iso-8859-1/_ude_3.txt', encoding = 'iso-8859-1'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b"La commedia non ha atti n\xe9 scene. La rappresentazione sar\xe0 interrotta una prima volta, senza che il ... mettersi in ginocchio e\ninchiodarli. Alle martellate accorrer\xe0 dalla porta dei camerini il Direttore di scena.\n")
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_1.txt-iso-8859-1]

_ude_1.txt-iso-8859-1]
file_name = 'tests/iso-8859-1/_ude_1.txt', encoding = 'iso-8859-1'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b"Nas paginas que em seguida se leem acha-se t\xe3o bem determinada, com tanta eloquencia e t\xe3o profunda ...stra\xeddo que se affasta da sala do festim, e cuja voz se perde pouco a pouco no silencio da distancia e da noute.\n")
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

nobom-utf32le.txt-utf-32le]

nobom-utf32le.txt-utf-32le]
file_name = 'tests/UTF-32LE/nobom-utf32le.txt', encoding = 'utf-32le'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'D\x00\x00\x00a\x00\x00\x00t\x00\x00\x00e\x00\x00\x00T\x00\x00\x00i\x00\x00\x00m\x00\x00\x00e\x00\x00\x00,\...x00\x00\x00.\x00\x00\x000\x00\x00\x008\x00\x00\x003\x00\x00\x005\x00\x00\x003\x00\x00\x00\r\x00\x00\x00\n\x00\x00\x00')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

plane1-utf-32le.html-utf-32le]

plane1-utf-32le.html-utf-32le]
file_name = 'tests/UTF-32LE/plane1-utf-32le.html', encoding = 'utf-32le'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'<\x00\x00\x00!\x00\x00\x00D\x00\x00\x00O\x00\x00\x00C\x00\x00\x00T\x00\x00\x00Y\x00\x00\x00P\x00\x00\x00E\...x00\x00\x00/\x00\x00\x00h\x00\x00\x00t\x00\x00\x00m\x00\x00\x00l\x00\x00\x00>\x00\x00\x00\r\x00\x00\x00\n\x00\x00\x00')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

bom-utf-16-le.srt-utf-16]

bom-utf-16-le.srt-utf-16]
file_name = 'tests/UTF-16/bom-utf-16-le.srt', encoding = 'utf-16'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b"\xff\xfe1\x00\n\x000\x000\x00:\x000\x000\x00:\x000\x006\x00,\x005\x000\x000\x00 \x00-\x00-\x00>\x00 \x000\... \x00g\x00l\x00o\x00b\x00a\x00l\x00 \x00a\x00w\x00a\x00r\x00e\x00n\x00e\x00s\x00s\x00 \x00d\x00a\x00y\x00\n\x00\n\x00")
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

bom-utf-16-be.srt-utf-16]

bom-utf-16-be.srt-utf-16]
file_name = 'tests/UTF-16/bom-utf-16-be.srt', encoding = 'utf-16'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b"\xfe\xff\x001\x00\n\x000\x000\x00:\x000\x000\x00:\x000\x006\x00,\x005\x000\x000\x00 \x00-\x00-\x00>\x00 \x...\x00 \x00g\x00l\x00o\x00b\x00a\x00l\x00 \x00a\x00w\x00a\x00r\x00e\x00n\x00e\x00s\x00s\x00 \x00d\x00a\x00y\x00\n\x00\n")
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

janulalife.blogspot.com.xml-iso-8859-5]

janulalife.blogspot.com.xml-iso-8859-5]
file_name = 'tests/iso-8859-5-russian/janulalife.blogspot.com.xml'
encoding = 'iso-8859-5'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n
\n\nfalse\n\n\n') ignore_threshold = True def detect_all(byte_str, ignore_threshold=False): """ Detect all the possible encodings of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` :param ignore_threshold: Include encodings that are below ``UniversalDetector.MINIMUM_THRESHOLD`` in results. :type ignore_threshold: ``bool`` """ if not isinstance(byte_str, bytearray): if not isinstance(byte_str, bytes): raise TypeError( f"Expected object of type bytes or bytearray, got: {type(byte_str)}" ) byte_str = bytearray(byte_str) detector = UniversalDetector() detector.feed(byte_str) detector.close() > if detector.input_state == InputState.HIGH_BYTE: E AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'? chardet/__init__.py:65: AttributeError

susu.ac.ru.xml-iso-8859-5]

susu.ac.ru.xml-iso-8859-5]
file_name = 'tests/iso-8859-5-russian/susu.ac.ru.xml', encoding = 'iso-8859-5'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

www2.chuo-u.ac.jp-suishin.xml-cp932]

www2.chuo-u.ac.jp-suishin.xml-cp932]
file_name = 'tests/CP932/www2.chuo-u.ac.jp-suishin.xml', encoding = 'cp932'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n\n\nkitaro@tamajs.chuo-u.ac.jp>\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

y-moto.com.xml-cp932]

y-moto.com.xml-cp932]
file_name = 'tests/CP932/y-moto.com.xml', encoding = 'cp932'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\...dc:subject/>\nkappa\n2003-12-03T11:37:49+03:00\n\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

forum.template-toolkit.ru.8.xml-ibm855]

forum.template-toolkit.ru.8.xml-ibm855]
file_name = 'tests/IBM855/forum.template-toolkit.ru.8.xml', encoding = 'ibm855'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\...  (N 1080 \xd6\xe5 17 \xd4\xd6\xde\xa2\xe1\xde 2005 \xac\xd6\xa6\xa0).\n\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

forum.template-toolkit.ru.6.xml-ibm855]

forum.template-toolkit.ru.6.xml-ibm855]
file_name = 'tests/IBM855/forum.template-toolkit.ru.6.xml', encoding = 'ibm855'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\...d4\xd4\xd6\xe3\xe5\xb7</a></li><li><a href=""http://model.exponenta.ru/"">Model.Exponenta.Ru ')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

janulalife.blogspot.com.xml-ibm855]

janulalife.blogspot.com.xml-ibm855]
file_name = 'tests/IBM855/janulalife.blogspot.com.xml', encoding = 'ibm855'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n
\n\nfalse\n\n\n') ignore_threshold = True def detect_all(byte_str, ignore_threshold=False): """ Detect all the possible encodings of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` :param ignore_threshold: Include encodings that are below ``UniversalDetector.MINIMUM_THRESHOLD`` in results. :type ignore_threshold: ``bool`` """ if not isinstance(byte_str, bytearray): if not isinstance(byte_str, bytes): raise TypeError( f"Expected object of type bytes or bytearray, got: {type(byte_str)}" ) byte_str = bytearray(byte_str) detector = UniversalDetector() detector.feed(byte_str) detector.close() > if detector.input_state == InputState.HIGH_BYTE: E AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'? chardet/__init__.py:65: AttributeError

forum.template-toolkit.ru.9.xml-ibm855]

forum.template-toolkit.ru.9.xml-ibm855]
file_name = 'tests/IBM855/forum.template-toolkit.ru.9.xml', encoding = 'ibm855'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\nLinux\n Fri, 09 Sep 2005 16:06:29 -0400\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

weblabor.hu.xml-utf-8]

weblabor.hu.xml-utf-8]
file_name = 'tests/utf-8/weblabor.hu.xml', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\nPHP\n Wed, 04 Jan 2006 11:15:54 +0100\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_mozilla_bug426271_text-utf-8.html-utf-8]

_mozilla_bug426271_text-utf-8.html-utf-8]
file_name = 'tests/utf-8/_mozilla_bug426271_text-utf-8.html', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n\n\xe6\x97...\xad\xe3\x83\x9a\xe3\x83\x87\xe3\x82\xa3\xe3\x82\xa2\xef\xbc\x88Wikipedia\xef\xbc\x89\xe3\x80\x8f\n</body>\n</html>\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError
</pre>
</details>
<h3 id="_ude_2txt-utf-8">_ude_2.txt-utf-8]</h3>
<details><summary> <pre>_ude_2.txt-utf-8]</pre></summary><pre>
file_name = 'tests/utf-8/_ude_2.txt', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b"\xeb\xb6\x81\xec\xa1\xb0\xec\x84\xa0 \xec\x82\xac\xeb\x9e\x8c\xeb\x93\xa4\xec\x9d\x80 \xed\x9d\x94\xed\x9e...d\x98\xeb\xaf\xb8\xed\x95\x98\xeb\x8a\x94 North Korea\xeb\x9d\xbc\xea\xb3\xa0 \xeb\xb6\x80\xeb\xa5\xb8\xeb\x8b\xa4.\n")
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError
</pre>
</details>
<h3 id="_ude_greektxt-utf-8">_ude_greek.txt-utf-8]</h3>
<details><summary> <pre>_ude_greek.txt-utf-8]</pre></summary><pre>
file_name = 'tests/utf-8/_ude_greek.txt', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\xce\x97 \xce\xb5\xce\xbb\xce\xbb\xce\xb7\xce\xbd\xce\xb9\xce\xba\xce\xae \xce\xb1\xcf\x80\xce\xbf\xcf\x84...cf\x83\xcf\x84\xce\xb1 20 \xce\xb5\xce\xba\xce\xb1\xcf\x84\xce\xbf\xce\xbc\xce\xbc\xcf\x8d\xcf\x81\xce\xb9\xce\xb1.\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError
</pre>
</details>
<h3 id="_ude_he3txt-utf-8">_ude_he3.txt-utf-8]</h3>
<details><summary> <pre>_ude_he3.txt-utf-8]</pre></summary><pre>
file_name = 'tests/utf-8/_ude_he3.txt', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\xd7\x90\xd7\x99\xd7\x9f \xd7\x9b\xd7\x9e\xd7\xa2\xd7\x98 \xd7\xa0\xd7\x99\xd7\x91\xd7\x99\xd7\x9d \xd7\x9...7\x94 \xd7\x90\xd7\x99\xd7\xa0\xd7\x95 \xd7\x92\xd7\x93\xd7\x95\xd7\x9c (\xd7\x99\xd7\x97\xd7\xa1\xd7\x99\xd7\xaa).\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError
</pre>
</details>
<h3 id="_ude_3txt-utf-8">_ude_3.txt-utf-8]</h3>
<details><summary> <pre>_ude_3.txt-utf-8]</pre></summary><pre>
file_name = 'tests/utf-8/_ude_3.txt', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\\\\\\\\\\\\\\{ssss } siaaaaaaaaa  ssss<ciao>i \xc3\xa0 \xc3\xa8 \xc3\xac\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError
</pre>
</details>
<h3 id="_ude_russiantxt-utf-8">_ude_russian.txt-utf-8]</h3>
<details><summary> <pre>_ude_russian.txt-utf-8]</pre></summary><pre>
file_name = 'tests/utf-8/_ude_russian.txt', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\xd0\x92 \xd0\xb3\xd0\xb8\xd0\xbc\xd0\xbd\xd0\xb0\xd0\xb7\xd0\xb8\xd0\xb8 \xd0\xbe\xd0\xbd \xd0\xbd\xd0\xb...0\xd0\xb8\xd1\x82\xd1\x8c \xd0\xbf\xd0\xbe\xd1\x81\xd1\x82\xd1\x83\xd0\xbf\xd0\xbb\xd0\xb5\xd0\xbd\xd0\xb8\xd0\xb5.\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError
</pre>
</details>
<h3 id="_mozilla_bug306272_texthtml-utf-8">_mozilla_bug306272_text.html-utf-8]</h3>
<details><summary> <pre>_mozilla_bug306272_text.html-utf-8]</pre></summary><pre>
file_name = 'tests/utf-8/_mozilla_bug306272_text.html', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n<html><head>\n\n  <title>306272\n...href="mailto:Antti.Nayha@somewhere.fi">Antti N\xc3\xa4yh\xc3\xa4 <Antti.Nayha@somewhere.fi>\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_he2.txt-utf-8]

_ude_he2.txt-utf-8]
file_name = 'tests/utf-8/_ude_he2.txt', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\xd7\x94\xd7\xa2\xd7\x91\xd7\xa8\xd7\x99\xd7\xaa \xd7\x94\xd7\x99\xd7\x90 \xd7\xa9\xd7\xa4\xd7\x94 \xd7\x9...xd7\x90 \xd7\x9e\xd7\xa9\xd7\xa4\xd7\x97\xd7\xaa \xd7\x90\xd7\x91\xd7\x9f \xd7\xaa\xd7\x99\xd7\x91\xd7\x95\xd7\x9f.\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_5.txt-utf-8]

_ude_5.txt-utf-8]
file_name = 'tests/utf-8/_ude_5.txt', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\xe4\xbb\x99\xe4\xba\xba\xe6\xb4\x9e\xe6\x96\x87\xe5\x8c\x96\xe4\xbf\x82\xe8\xa9\xb1\xe5\x88\xb0\xe8\x90\x...\xe5\x8d\x80\n\n1\xe9\x9a\xbb\xe5\x88\x86\xe9\xa1\x9e: \xe6\xb1\x9f\xe8\xa5\xbf\xe5\x97\xb0\xe6\xad\xb7\xe5\x8f\xb2\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_chromium_UTF-8_with_no_encoding_specified.html-utf-8]

_chromium_UTF-8_with_no_encoding_specified.html-utf-8]
file_name = 'tests/utf-8/_chromium_UTF-8_with_no_encoding_specified.html'
encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n   UTF-8 \n \n  \xe9\xba\xa6\xe8\x92\x82\xe7\x9a\x84\xe5\xa4\xa9...\xe5\xbf\x85\xe9\xa1\xbb\xe5\x8a\xaa\xe5\x8a\x9b\xe6\x89\x8d\xe8\xa1\x8c\xe3\x80\x82\xe2\x80\x9d\n \n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

pihgy.hu.xml-utf-8]

pihgy.hu.xml-utf-8]
file_name = 'tests/utf-8/pihgy.hu.xml', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n\n Thu, 27 Oct 2005 17:30:09 +0200\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

weblabor.hu.2.xml-utf-8]

weblabor.hu.2.xml-utf-8]
file_name = 'tests/utf-8/weblabor.hu.2.xml', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\nAdatb\xc3\xa1zis\n Mon, 19 Dec 2005 00:12:29 +0100\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_he1.txt-utf-8]

_ude_he1.txt-utf-8]
file_name = 'tests/utf-8/_ude_he1.txt', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\xd7\x94\xd7\xa9\xd7\x9d \xd7\xa2\xd7\x91\xd7\xa8 \xd7\x9e\xd7\x95\xd7\xa4\xd7\x99\xd7\xa2 \xd7\x91\xd7\xa...\xd7\x91\xd7\xa8 \xd7\x91\xd7\x90\xd7\x96\xd7\x95\xd7\xa8 \xd7\x99\xd7\xa8\xd7\x95\xd7\xa9\xd7\x9c\xd7\x99\xd7\x9d.\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

balatonblog.typepad.com.xml-utf-8]

balatonblog.typepad.com.xml-utf-8]
file_name = 'tests/utf-8/balatonblog.typepad.com.xml', encoding = 'utf-8'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\.../dc:subject>\nkappa\n2003-12-03T11:37:49+03:00\n\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

susu.ac.ru.xml-koi8-r]

susu.ac.ru.xml-koi8-r]
file_name = 'tests/KOI8-R/susu.ac.ru.xml', encoding = 'koi8-r'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\...de\xc1\xcc\xcf \xd7 13.00.\nhttp://susu.ac.ru/ru/news/1321\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

music.peeps.ru.xml-koi8-r]

music.peeps.ru.xml-koi8-r]
file_name = 'tests/KOI8-R/music.peeps.ru.xml', encoding = 'koi8-r'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\..."   (N 1080 \xcf\xd4 17 \xce\xcf\xd1\xc2\xd2\xd1 2005 \xc7\xcf\xc4\xc1).\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

koi.kinder.ru.xml-koi8-r]

koi.kinder.ru.xml-koi8-r]
file_name = 'tests/KOI8-R/koi.kinder.ru.xml', encoding = 'koi8-r'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\...dc:subject/>\nkappa\n2003-12-03T11:37:49+03:00\n\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

money.rin.ru.xml-ibm866]

money.rin.ru.xml-ibm866]
file_name = 'tests/IBM866/money.rin.ru.xml', encoding = 'ibm866'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\...  (N 1080 \xae\xe2 17 \xad\xae\xef\xa1\xe0\xef 2005 \xa3\xae\xa4\xa0).\n\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

forum.template-toolkit.ru.1.xml-ibm866]

forum.template-toolkit.ru.1.xml-ibm866]
file_name = 'tests/IBM866/forum.template-toolkit.ru.1.xml', encoding = 'ibm866'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\...ad\xad\xae\xe1\xe2\xa8</a></li><li><a href=""http://model.exponenta.ru/"">Model.Exponenta.Ru ')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_1.txt-ibm866]

_ude_1.txt-ibm866]
file_name = 'tests/IBM866/_ude_1.txt', encoding = 'ibm866'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\x82 \xa3\xa8\xac\xad\xa0\xa7\xa8\xa8 \xae\xad \xad\xa5 \xa1\xeb\xab \xa2 \xe7\xa8\xe1\xab\xa5 \xaf\xa5\xe...xe2\xe2\xa5\xe1\xe2\xa0\xe2 \xa8 \xaf\xae\xa2\xe2\xae\xe0\xa8\xe2\xec \xaf\xae\xe1\xe2\xe3\xaf\xab\xa5\xad\xa8\xa5.\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

forum.template-toolkit.ru.9.xml-ibm866]

forum.template-toolkit.ru.9.xml-ibm866]
file_name = 'tests/IBM866/forum.template-toolkit.ru.9.xml', encoding = 'ibm866'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n 00:00:04,416\nBenim ad\xfdm Abaddon.\n\n2\n00:00:04,417 --> 00:00:06,051\nCehennemin S...8,373\nNe olursa olsun\nyerlerinizi koruyun!\n\n22\n00:01:18,375 --> 00:01:19,825\nSava\xfe\xe7\xfd korunmal\xfd.\n\n")
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

manana.moo.jp.xml-euc-jp]

manana.moo.jp.xml-euc-jp]
file_name = 'tests/EUC-JP/manana.moo.jp.xml', encoding = 'euc-jp'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n...\nnanana\n2005-03-06T11:43:59+09:00\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

contents-factory.com.xml-euc-jp]

contents-factory.com.xml-euc-jp]
file_name = 'tests/EUC-JP/contents-factory.com.xml', encoding = 'euc-jp'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n\neizo\n2005-11-24T15:25:17+09:00\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_mozilla_bug431054_text.html-euc-jp]

_mozilla_bug431054_text.html-euc-jp]
file_name = 'tests/EUC-JP/_mozilla_bug431054_text.html', encoding = 'euc-jp'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n\xa5\xed\xa5\xb0\xa5\xa4\xa5\xf3\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

mimizun.com.xml-euc-jp]

mimizun.com.xml-euc-jp]
file_name = 'tests/EUC-JP/mimizun.com.xml', encoding = 'euc-jp'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n...n\nsiwoo\nWed, 15 Jun 2005 10:18:21 +0900\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

jely.pe.kr.xml-euc-kr]

jely.pe.kr.xml-euc-kr]
file_name = 'tests/EUC-KR/jely.pe.kr.xml', encoding = 'euc-kr'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n<...d>\nmonologue\n2004-10-19T08:53:44+09:00\n\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

sparcs.kaist.ac.kr.xml-euc-kr]

sparcs.kaist.ac.kr.xml-euc-kr]
file_name = 'tests/EUC-KR/sparcs.kaist.ac.kr.xml', encoding = 'euc-kr'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n...acO\xa7A\xaa\xba\xa4F! \xc1\xd9\xacO\xa7\xd6\xb7Q\xb7Q\xa7O\xaa\xba\xa8\xc6\xa7a !  \n\t\n\t')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

carbonxiv.blogspot.com.xml-big5]

carbonxiv.blogspot.com.xml-big5]
file_name = 'tests/Big5/carbonxiv.blogspot.com.xml', encoding = 'big5'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n
\n\nfalse\n\n\n') ignore_threshold = True def detect_all(byte_str, ignore_threshold=False): """ Detect all the possible encodings of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` :param ignore_threshold: Include encodings that are below ``UniversalDetector.MINIMUM_THRESHOLD`` in results. :type ignore_threshold: ``bool`` """ if not isinstance(byte_str, bytearray): if not isinstance(byte_str, bytes): raise TypeError( f"Expected object of type bytes or bytearray, got: {type(byte_str)}" ) byte_str = bytearray(byte_str) detector = UniversalDetector() detector.feed(byte_str) detector.close() > if detector.input_state == InputState.HIGH_BYTE: E AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'? chardet/__init__.py:65: AttributeError

kafkatseng.blogspot.com.xml-big5]

kafkatseng.blogspot.com.xml-big5]
file_name = 'tests/Big5/kafkatseng.blogspot.com.xml', encoding = 'big5'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\nfalse\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

ebao.us.xml-big5]

ebao.us.xml-big5]
file_name = 'tests/Big5/ebao.us.xml', encoding = 'big5'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n<...fw:commentRSS>http://unoriginalblog.com/2005/11/another-day/feed/\n\t\n\t\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

celeb.lalalu.com.xml-shift_jis]

celeb.lalalu.com.xml-shift_jis]
file_name = 'tests/SHIFT_JIS/celeb.lalalu.com.xml', encoding = 'shift_jis'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n...ws\nelel\n2005-12-28T01:32:13+09:00\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

clickablewords.com.xml-shift_jis]

clickablewords.com.xml-shift_jis]
file_name = 'tests/SHIFT_JIS/clickablewords.com.xml', encoding = 'shift_jis'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n

]]>\n\n\n\n\n') ignore_threshold = True def detect_all(byte_str, ignore_threshold=False): """ Detect all the possible encodings of the given byte string. :param byte_str: The byte sequence to examine. :type byte_str: ``bytes`` or ``bytearray`` :param ignore_threshold: Include encodings that are below ``UniversalDetector.MINIMUM_THRESHOLD`` in results. :type ignore_threshold: ``bool`` """ if not isinstance(byte_str, bytearray): if not isinstance(byte_str, bytes): raise TypeError( f"Expected object of type bytes or bytearray, got: {type(byte_str)}" ) byte_str = bytearray(byte_str) detector = UniversalDetector() detector.feed(byte_str) detector.close() > if detector.input_state == InputState.HIGH_BYTE: E AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'? chardet/__init__.py:65: AttributeError

setsuzei119.jp.xml-shift_jis]

setsuzei119.jp.xml-shift_jis]
file_name = 'tests/SHIFT_JIS/setsuzei119.jp.xml', encoding = 'shift_jis'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n]]>\nhttp://ricanet.com/new/view.php?id=blog/100206\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_1.txt-iso-2022-jp]

_ude_1.txt-iso-2022-jp]
file_name = 'tests/iso-2022-jp/_ude_1.txt', encoding = 'iso-2022-jp'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'========================================================================\n    \x1b$B%3%s%=!<%k\x1b(J \x1b$...!<%9ItJ,$r<($7$^$9!#\x1b(J\n\n/////////////////////////////////////////////////////////////////////////////\n\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_iso2.txt-iso-2022-kr]

_ude_iso2.txt-iso-2022-kr]
file_name = 'tests/iso-2022-kr/_ude_iso2.txt', encoding = 'iso-2022-kr'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b"\x1b$)C\x0e:OA6<1\x0f \x0e;g6w5i@:\x0f \x0eHgHw\x0f \x0e@Z19@;\x0f \x0eA6<1\x0f(\x0epH`X\x0f)\x0e@L3*\x0f ...'\x0eA6<19]55\x0f(\x0eGQ9]55\x0f) \x0e:OBJ\x0f\'\x0e@;\x0f \x0e@G9LGO4B\x0f North Korea\x0e6s0m\x0f \x0e:N8%4Y\x0f.\n")
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_iso1.txt-iso-2022-kr]

_ude_iso1.txt-iso-2022-kr]
file_name = 'tests/iso-2022-kr/_ude_iso1.txt', encoding = 'iso-2022-kr'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\x1b$)C\x0e?*;g@{\x0f \x0e?9       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

cappuccinos.3322.org.xml-gb2312]

cappuccinos.3322.org.xml-gb2312]
file_name = 'tests/GB2312/cappuccinos.3322.org.xml', encoding = 'gb2312'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\n\n\n\n\n\n 00:00:09,000\nAbout 2 months ago I found myself on\nthe comment section of...00:50,000\nSo what I thought I do is instead if answering on a YouTube comment is organize a global awareness day\n\n")
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

_ude_4.txt-utf-8-sig]

_ude_4.txt-utf-8-sig]
file_name = 'tests/utf-8-sig/_ude_4.txt', encoding = 'utf-8-sig'

    @pytest.mark.parametrize("file_name, encoding", gen_test_params())
    def test_encoding_detection(file_name, encoding):
        with open(file_name, "rb") as f:
            input_bytes = f.read()
            result = chardet.detect(input_bytes)
            try:
                expected_unicode = input_bytes.decode(encoding)
            except LookupError:
                expected_unicode = ""
            try:
                detected_unicode = input_bytes.decode(result["encoding"])
            except (LookupError, UnicodeDecodeError, TypeError):
                detected_unicode = ""
        if result:
            encoding_match = (result["encoding"] or "").lower() == encoding
        else:
            encoding_match = False
        # Only care about mismatches that would actually result in different
        # behavior when decoding
        if not encoding_match and expected_unicode != detected_unicode:
            wrapped_expected = "\n".join(textwrap.wrap(expected_unicode, 100)) + "\n"
            wrapped_detected = "\n".join(textwrap.wrap(detected_unicode, 100)) + "\n"
            diff = "".join(
                list(
                    ndiff(
                        wrapped_expected.splitlines(True), wrapped_detected.splitlines(True)
                    )
                )[:20]
            )
>           all_encodings = chardet.detect_all(input_bytes, ignore_threshold=True)

test.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'\xef\xbb\xbf========================================================================\n    \xe3\x82\xb3\xe3...be\xe3\x81\x99\xe3\x80\x82\n\n/////////////////////////////////////////////////////////////////////////////\n\n\n\n\n')
ignore_threshold = True

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

test.py::test_never_fails_to_detect_if_there_is_a_valid_encoding

test.py::test_never_fails_to_detect_if_there_is_a_valid_encoding
@pytest.mark.xfail
>   @given(
        st.text(min_size=1),
        st.sampled_from(
            [
                "ascii",
                "utf-8",
                "utf-16",
                "utf-32",
                "iso-8859-7",
                "iso-8859-8",
                "windows-1255",
            ]
        ),
        st.randoms(),
    )

test.py:123: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

txt = '0', enc = 'ascii', rnd = HypothesisRandom(generated data)

    @pytest.mark.xfail
    @given(
        st.text(min_size=1),
        st.sampled_from(
            [
                "ascii",
                "utf-8",
                "utf-16",
                "utf-32",
                "iso-8859-7",
                "iso-8859-8",
                "windows-1255",
            ]
        ),
        st.randoms(),
    )
    @settings(max_examples=200)
    def test_never_fails_to_detect_if_there_is_a_valid_encoding(txt, enc, rnd):
        try:
            data = txt.encode(enc)
        except UnicodeEncodeError:
            assume(False)
>       detected = chardet.detect(data)["encoding"]
E       TypeError: 'NoneType' object is not subscriptable
E       Falsifying example: test_never_fails_to_detect_if_there_is_a_valid_encoding(
E           txt='0',
E           enc='ascii',  # or any other generated value
E           rnd=HypothesisRandom(generated data),
E       )

test.py:144: TypeError

test.py::test_detect_all_and_detect_one_should_agree

test.py::test_detect_all_and_detect_one_should_agree
txt = '0', enc = 'ascii', _ = HypothesisRandom(generated data)

    @given(
        st.text(min_size=1),
        st.sampled_from(
            [
                "ascii",
                "utf-8",
                "utf-16",
                "utf-32",
                "iso-8859-7",
                "iso-8859-8",
                "windows-1255",
            ]
        ),
        st.randoms(),
    )
    @settings(max_examples=200)
    def test_detect_all_and_detect_one_should_agree(txt, enc, _):
        try:
            data = txt.encode(enc)
        except UnicodeEncodeError:
            assume(False)
        try:
            result = chardet.detect(data)
>           results = chardet.detect_all(data)

test.py:182: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

byte_str = bytearray(b'0'), ignore_threshold = False

    def detect_all(byte_str, ignore_threshold=False):
        """
        Detect all the possible encodings of the given byte string.

        :param byte_str:          The byte sequence to examine.
        :type byte_str:           ``bytes`` or ``bytearray``
        :param ignore_threshold:  Include encodings that are below
                                  ``UniversalDetector.MINIMUM_THRESHOLD``
                                  in results.
        :type ignore_threshold:   ``bool``
        """
        if not isinstance(byte_str, bytearray):
            if not isinstance(byte_str, bytes):
                raise TypeError(
                    f"Expected object of type bytes or bytearray, got: {type(byte_str)}"
                )
            byte_str = bytearray(byte_str)

        detector = UniversalDetector()
        detector.feed(byte_str)
        detector.close()

>       if detector.input_state == InputState.HIGH_BYTE:
E       AttributeError: 'UniversalDetector' object has no attribute 'input_state'. Did you mean: '_input_state'?

chardet/__init__.py:65: AttributeError

During handling of the above exception, another exception occurred:

    @given(
>       st.text(min_size=1),
        st.sampled_from(
            [
                "ascii",
                "utf-8",
                "utf-16",
                "utf-32",
                "iso-8859-7",
                "iso-8859-8",
                "windows-1255",
            ]
        ),
        st.randoms(),
    )

test.py:160: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

txt = '0', enc = 'ascii', _ = HypothesisRandom(generated data)

    @given(
        st.text(min_size=1),
        st.sampled_from(
            [
                "ascii",
                "utf-8",
                "utf-16",
                "utf-32",
                "iso-8859-7",
                "iso-8859-8",
                "windows-1255",
            ]
        ),
        st.randoms(),
    )
    @settings(max_examples=200)
    def test_detect_all_and_detect_one_should_agree(txt, enc, _):
        try:
            data = txt.encode(enc)
        except UnicodeEncodeError:
            assume(False)
        try:
            result = chardet.detect(data)
            results = chardet.detect_all(data)
            assert result["encoding"] == results[0]["encoding"]
        except Exception as exc:
>           raise RuntimeError(f"{result} != {results}") from exc
E           UnboundLocalError: cannot access local variable 'results' where it is not associated with a value
E           Falsifying example: test_detect_all_and_detect_one_should_agree(
E               txt='0',
E               enc='ascii',  # or any other generated value
E               _=HypothesisRandom(generated data),
E           )

test.py:185: UnboundLocalError

Patch diff