File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
import subprocess
2
2
from typing import NamedTuple
3
3
4
- import chardet
4
+ from charset_normalizer import from_bytes
5
5
6
6
7
7
class Command (NamedTuple ):
@@ -23,8 +23,8 @@ def run(cmd: str) -> Command:
23
23
stdout , stderr = process .communicate ()
24
24
return_code = process .returncode
25
25
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 () ),
28
28
stdout ,
29
29
stderr ,
30
30
return_code ,
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ jinja2 = ">=2.10.3"
56
56
pyyaml = " >=3.08"
57
57
argcomplete = " ^1.12.1"
58
58
typing-extensions = " ^4.0.1"
59
- chardet = " ^5.0 .0"
59
+ charset-normalizer = " ^2.1 .0"
60
60
61
61
[tool .poetry .dev-dependencies ]
62
62
ipython = " ^7.2"
@@ -82,7 +82,6 @@ mkdocs = "^1.0"
82
82
mkdocs-material = " ^4.1"
83
83
pydocstyle = " ^5.0.2"
84
84
pytest-xdist = " ^2.5.0"
85
- types-chardet = " ^5.0.2"
86
85
87
86
[tool .poetry .scripts ]
88
87
cz = " commitizen.cli:main"
You can’t perform that action at this time.
0 commit comments