Skip to content

Fix DeprecationWarning: chardet.universaldetector is deprecated - #602

Open
vivodi wants to merge 1 commit into
html5lib:masterfrom
vivodi:vivodi-patch-1
Open

Fix DeprecationWarning: chardet.universaldetector is deprecated#602
vivodi wants to merge 1 commit into
html5lib:masterfrom
vivodi:vivodi-patch-1

Conversation

@vivodi

Copy link
Copy Markdown

Fix#601

fromchardet.universaldetectorimportUniversalDetector

C:\Users\vivodi\Projects\Flexget\.venv\Lib\site-packages\html5lib\html5parser.py:284: inparseself._parse(stream, False, None, *args, **kwargs)
C:\Users\vivodi\Projects\Flexget\.venv\Lib\site-packages\html5lib\html5parser.py:129: in_parseself.tokenizer=_tokenizer.HTMLTokenizer(stream, parser=self, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C:\Users\vivodi\Projects\Flexget\.venv\Lib\site-packages\html5lib\_tokenizer.py:42: in__init__self.stream=HTMLInputStream(stream, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C:\Users\vivodi\Projects\Flexget\.venv\Lib\site-packages\html5lib\_inputstream.py:145: inHTMLInputStreamreturnHTMLBinaryInputStream(source, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C:\Users\vivodi\Projects\Flexget\.venv\Lib\site-packages\html5lib\_inputstream.py:422: in__init__self.charEncoding=self.determineEncoding(useChardet)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C:\Users\vivodi\Projects\Flexget\.venv\Lib\site-packages\html5lib\_inputstream.py:486: indetermineEncodingfromchardet.universaldetectorimportUniversalDetector__ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"""Backward-compatibility stub for ``chardet.universaldetector``. chardet 6.x exposed :class:`UniversalDetector` via this module path. In chardet 7+ the canonical location is :mod:`chardet.detector`, but this stub keeps ``from chardet.universaldetector import UniversalDetector`` working for existing callers. .. deprecated:: 7.0 Import from :mod:`chardet` or :mod:`chardet.detector` instead. """from __future__ importannotationsimportwarningsfromchardet.detectorimportUniversalDetector>warnings.warn(
"chardet.universaldetector is deprecated, ""import UniversalDetector from chardet or chardet.detector instead",
DeprecationWarning,
stacklevel=2,
)
EDeprecationWarning: chardet.universaldetectorisdeprecated, importUniversalDetectorfromchardetorchardet.detectorinstead

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning: chardet.universaldetector is deprecated, import UniversalDetector from chardet or chardet.detector instead

1 participant

@vivodi