File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import subprocess
22from typing import NamedTuple
33
4- import chardet
4+ from charset_normalizer import from_bytes
55
66
77class Command (NamedTuple ):
@@ -23,8 +23,8 @@ def run(cmd: str) -> Command:
2323 stdout , stderr = process .communicate ()
2424 return_code = process .returncode
2525 return Command (
26- stdout . decode ( chardet . detect (stdout )[ "encoding" ] or "utf-8" ),
27- stderr . decode ( chardet . detect (stderr )[ "encoding" ] or "utf-8" ),
26+ str ( from_bytes (stdout ). best () ),
27+ str ( from_bytes (stderr ). best () ),
2828 stdout ,
2929 stderr ,
3030 return_code ,
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ jinja2 = ">=2.10.3"
5656pyyaml = " >=3.08"
5757argcomplete = " ^1.12.1"
5858typing-extensions = " ^4.0.1"
59- chardet = " ^5.0 .0"
59+ charset-normalizer = " ^2.1 .0"
6060
6161[tool .poetry .dev-dependencies ]
6262ipython = " ^7.2"
@@ -82,7 +82,6 @@ mkdocs = "^1.0"
8282mkdocs-material = " ^4.1"
8383pydocstyle = " ^5.0.2"
8484pytest-xdist = " ^2.5.0"
85- types-chardet = " ^5.0.2"
8685
8786[tool .poetry .scripts ]
8887cz = " commitizen.cli:main"
You can’t perform that action at this time.
0 commit comments