from pathlib import Path


def remove_line_number(path):
    """
    Takes a path/to/file:line path and returns path/to/file path object
    """
    parts = list(Path(path).parts)
    parts[-1] = parts[-1].split(':')[0]
    return Path(*parts)