from typing import Union
from pathlib import Path


def read_lines(path: Union[Path, str], encoding: str = "utf-8") -> list[str]:
    """
    Read the lines in a file
    """
    with open(path, encoding=encoding) as infile:
        return [line for line in infile if line.strip()]