From 86617ac570b4d53e0af28dc16e4505700e0e8eff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 07:02:50 +0100 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20black=20from=2022.1?= =?UTF-8?q?2.0=20to=2023.1.0=20(#265)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :arrow_up: Bump black from 22.12.0 to 23.1.0 Bumps [black](https://github.com/psf/black) from 22.12.0 to 23.1.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/22.12.0...23.1.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * :art: reformat files using latest `black` --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ahmed TAHRI --- charset_normalizer/api.py | 5 +++-- charset_normalizer/cd.py | 1 - charset_normalizer/cli/normalizer.py | 2 -- charset_normalizer/utils.py | 4 ---- dev-requirements.txt | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/charset_normalizer/api.py b/charset_normalizer/api.py index 6c7e8983..9dbf4201 100644 --- a/charset_normalizer/api.py +++ b/charset_normalizer/api.py @@ -175,7 +175,6 @@ def from_bytes( prioritized_encodings.append("utf_8") for encoding_iana in prioritized_encodings + IANA_SUPPORTED: - if cp_isolation and encoding_iana not in cp_isolation: continue @@ -318,7 +317,9 @@ def from_bytes( bom_or_sig_available and strip_sig_or_bom is False ): break - except UnicodeDecodeError as e: # Lazy str loading may have missed something there + except ( + UnicodeDecodeError + ) as e: # Lazy str loading may have missed something there logger.log( TRACE, "LazyStr Loading: After MD chunk decode, code page %s does not fit given bytes sequence at ALL. %s", diff --git a/charset_normalizer/cd.py b/charset_normalizer/cd.py index ae2813fb..6e56fe84 100644 --- a/charset_normalizer/cd.py +++ b/charset_normalizer/cd.py @@ -140,7 +140,6 @@ def alphabet_languages( source_have_accents = any(is_accentuated(character) for character in characters) for language, language_characters in FREQUENCIES.items(): - target_have_accents, target_pure_latin = get_target_features(language) if ignore_non_latin and target_pure_latin is False: diff --git a/charset_normalizer/cli/normalizer.py b/charset_normalizer/cli/normalizer.py index ad26b4d0..f4bcbaac 100644 --- a/charset_normalizer/cli/normalizer.py +++ b/charset_normalizer/cli/normalizer.py @@ -147,7 +147,6 @@ def cli_detect(argv: Optional[List[str]] = None) -> int: x_ = [] for my_file in args.files: - matches = from_fp(my_file, threshold=args.threshold, explain=args.verbose) best_guess = matches.best() @@ -222,7 +221,6 @@ def cli_detect(argv: Optional[List[str]] = None) -> int: ) if args.normalize is True: - if best_guess.encoding.startswith("utf") is True: print( '"{}" file does not need to be normalized, as it already came from unicode.'.format( diff --git a/charset_normalizer/utils.py b/charset_normalizer/utils.py index e3536267..76eafc64 100644 --- a/charset_normalizer/utils.py +++ b/charset_normalizer/utils.py @@ -311,7 +311,6 @@ def range_scan(decoded_sequence: str) -> List[str]: def cp_similarity(iana_name_a: str, iana_name_b: str) -> float: - if is_multi_byte_encoding(iana_name_a) or is_multi_byte_encoding(iana_name_b): return 0.0 @@ -351,7 +350,6 @@ def set_logging_handler( level: int = logging.INFO, format_string: str = "%(asctime)s | %(levelname)s | %(message)s", ) -> None: - logger = logging.getLogger(name) logger.setLevel(level) @@ -371,7 +369,6 @@ def cut_sequence_chunks( is_multi_byte_decoder: bool, decoded_payload: Optional[str] = None, ) -> Generator[str, None, None]: - if decoded_payload and is_multi_byte_decoder is False: for i in offsets: chunk = decoded_payload[i : i + chunk_size] @@ -397,7 +394,6 @@ def cut_sequence_chunks( # multi-byte bad cutting detector and adjustment # not the cleanest way to perform that fix but clever enough for now. if is_multi_byte_decoder and i > 0: - chunk_partial_size_chk: int = min(chunk_size, 16) if ( diff --git a/dev-requirements.txt b/dev-requirements.txt index e3cdf4a3..503a1620 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -6,7 +6,7 @@ pytest-cov==4.0.0 build==0.10.0 wheel==0.38.4 -black==22.12.0 +black==23.1.0 mypy==1.0.1 Flask==2.2.3 pytest==7.2.1