INNER CODE UNIT · Python

is_text_path

uxlfoundation/oneDAL · dev/release_tests/compare_release_trees.py:436

def is_text_path(path):
    p = Path(path)
    if p.name in TEXT_NAMES:
        return True
    if p.suffix.lower() in TEXT_SUFFIXES:
        return True
    if p.suffix.lower() in BINARY_SUFFIXES:
        return False
    return False


def read_normalized_text(root, path):
    # `newline=""` keeps each line's own ending. Without it Python's universal
    # newline translation folds CRLF to LF, which would make the files listed in
    # NORMALIZED_TEXT_LINES the only released text files where a line-ending
    # difference is invisible -- every other one is compared byte for byte.
    # `Path.read_text` only grew a `newline` parameter in Python 3.13, and CI
    # still runs 3.12, so go through `open`.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…