Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vendor/bin/normalizer
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/local/python/3.12.1/bin/python3
#!/opt/homebrew/opt/[email protected]/bin/python3.13
# -*- coding: utf-8 -*-
import re
import sys
from charset_normalizer.cli import cli_detect
from charset_normalizer import cli
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(cli_detect())
sys.exit(cli.cli_detect())
2 changes: 1 addition & 1 deletion vendor/certifi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .core import contents, where

__all__ = ["contents", "where"]
__version__ = "2024.08.30"
__version__ = "2025.04.26"
497 changes: 122 additions & 375 deletions vendor/certifi/cacert.pem

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion vendor/charset_normalizer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
Charset-Normalizer
~~~~~~~~~~~~~~
Expand All @@ -19,6 +18,9 @@
:copyright: (c) 2021 by Ahmed TAHRI
:license: MIT, see LICENSE for more details.
"""

from __future__ import annotations

import logging

from .api import from_bytes, from_fp, from_path, is_binary
Expand Down
2 changes: 2 additions & 0 deletions vendor/charset_normalizer/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from .cli import cli_detect

if __name__ == "__main__":
Expand Down
60 changes: 30 additions & 30 deletions vendor/charset_normalizer/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from __future__ import annotations

import logging
from os import PathLike
from typing import BinaryIO, List, Optional, Set, Union
from typing import BinaryIO

from .cd import (
coherence_ratio,
Expand All @@ -21,8 +23,6 @@
should_strip_sig_or_bom,
)

# Will most likely be controversial
# logging.addLevelName(TRACE, "TRACE")
logger = logging.getLogger("charset_normalizer")
explain_handler = logging.StreamHandler()
explain_handler.setFormatter(
Expand All @@ -31,12 +31,12 @@


def from_bytes(
sequences: Union[bytes, bytearray],
sequences: bytes | bytearray,
steps: int = 5,
chunk_size: int = 512,
threshold: float = 0.2,
cp_isolation: Optional[List[str]] = None,
cp_exclusion: Optional[List[str]] = None,
cp_isolation: list[str] | None = None,
cp_exclusion: list[str] | None = None,
preemptive_behaviour: bool = True,
explain: bool = False,
language_threshold: float = 0.1,
Expand All @@ -62,7 +62,7 @@ def from_bytes(

if not isinstance(sequences, (bytearray, bytes)):
raise TypeError(
"Expected object of type bytes or bytearray, got: {0}".format(
"Expected object of type bytes or bytearray, got: {}".format(
type(sequences)
)
)
Expand All @@ -76,7 +76,7 @@ def from_bytes(

if length == 0:
logger.debug("Encoding detection on empty bytes, assuming utf_8 intention.")
if explain:
if explain: # Defensive: ensure exit path clean handler
logger.removeHandler(explain_handler)
logger.setLevel(previous_logger_level or logging.WARNING)
return CharsetMatches([CharsetMatch(sequences, "utf_8", 0.0, False, [], "")])
Expand Down Expand Up @@ -135,9 +135,9 @@ def from_bytes(
),
)

prioritized_encodings: List[str] = []
prioritized_encodings: list[str] = []

specified_encoding: Optional[str] = (
specified_encoding: str | None = (
any_specified_encoding(sequences) if preemptive_behaviour else None
)

Expand All @@ -149,13 +149,13 @@ def from_bytes(
specified_encoding,
)

tested: Set[str] = set()
tested_but_hard_failure: List[str] = []
tested_but_soft_failure: List[str] = []
tested: set[str] = set()
tested_but_hard_failure: list[str] = []
tested_but_soft_failure: list[str] = []

fallback_ascii: Optional[CharsetMatch] = None
fallback_u8: Optional[CharsetMatch] = None
fallback_specified: Optional[CharsetMatch] = None
fallback_ascii: CharsetMatch | None = None
fallback_u8: CharsetMatch | None = None
fallback_specified: CharsetMatch | None = None

results: CharsetMatches = CharsetMatches()

Expand Down Expand Up @@ -189,7 +189,7 @@ def from_bytes(

tested.add(encoding_iana)

decoded_payload: Optional[str] = None
decoded_payload: str | None = None
bom_or_sig_available: bool = sig_encoding == encoding_iana
strip_sig_or_bom: bool = bom_or_sig_available and should_strip_sig_or_bom(
encoding_iana
Expand Down Expand Up @@ -292,7 +292,7 @@ def from_bytes(
early_stop_count: int = 0
lazy_str_hard_failure = False

md_chunks: List[str] = []
md_chunks: list[str] = []
md_ratios = []

try:
Expand Down Expand Up @@ -397,7 +397,7 @@ def from_bytes(
)

if not is_multi_byte_decoder:
target_languages: List[str] = encoding_languages(encoding_iana)
target_languages: list[str] = encoding_languages(encoding_iana)
else:
target_languages = mb_encoding_languages(encoding_iana)

Expand Down Expand Up @@ -462,7 +462,7 @@ def from_bytes(
"Encoding detection: %s is most likely the one.",
current_match.encoding,
)
if explain:
if explain: # Defensive: ensure exit path clean handler
logger.removeHandler(explain_handler)
logger.setLevel(previous_logger_level)
return CharsetMatches([current_match])
Expand All @@ -480,7 +480,7 @@ def from_bytes(
"Encoding detection: %s is most likely the one.",
probable_result.encoding,
)
if explain:
if explain: # Defensive: ensure exit path clean handler
logger.removeHandler(explain_handler)
logger.setLevel(previous_logger_level)

Expand All @@ -492,7 +492,7 @@ def from_bytes(
"the beginning of the sequence.",
encoding_iana,
)
if explain:
if explain: # Defensive: ensure exit path clean handler
logger.removeHandler(explain_handler)
logger.setLevel(previous_logger_level)
return CharsetMatches([results[encoding_iana]])
Expand Down Expand Up @@ -546,8 +546,8 @@ def from_fp(
steps: int = 5,
chunk_size: int = 512,
threshold: float = 0.20,
cp_isolation: Optional[List[str]] = None,
cp_exclusion: Optional[List[str]] = None,
cp_isolation: list[str] | None = None,
cp_exclusion: list[str] | None = None,
preemptive_behaviour: bool = True,
explain: bool = False,
language_threshold: float = 0.1,
Expand All @@ -572,12 +572,12 @@ def from_fp(


def from_path(
path: Union[str, bytes, PathLike], # type: ignore[type-arg]
path: str | bytes | PathLike, # type: ignore[type-arg]
steps: int = 5,
chunk_size: int = 512,
threshold: float = 0.20,
cp_isolation: Optional[List[str]] = None,
cp_exclusion: Optional[List[str]] = None,
cp_isolation: list[str] | None = None,
cp_exclusion: list[str] | None = None,
preemptive_behaviour: bool = True,
explain: bool = False,
language_threshold: float = 0.1,
Expand All @@ -603,12 +603,12 @@ def from_path(


def is_binary(
fp_or_path_or_payload: Union[PathLike, str, BinaryIO, bytes], # type: ignore[type-arg]
fp_or_path_or_payload: PathLike | str | BinaryIO | bytes, # type: ignore[type-arg]
steps: int = 5,
chunk_size: int = 512,
threshold: float = 0.20,
cp_isolation: Optional[List[str]] = None,
cp_exclusion: Optional[List[str]] = None,
cp_isolation: list[str] | None = None,
cp_exclusion: list[str] | None = None,
preemptive_behaviour: bool = True,
explain: bool = False,
language_threshold: float = 0.1,
Expand Down
Loading
Loading