INNER CODE UNIT · Python

complain_about_duplicate_paths

marcelm/cutadapt · src/cutadapt/cli.py:470

def complain_about_duplicate_paths(paths: list[str]):
    if sys.platform == "win32" and sys.version_info < (3, 8):
        # Bug in handling of NUL
        return
    seen = set()
    for path in paths:
        if path is None:
            continue
        p = Path(path)
        if p.exists() and not p.is_file():
            # assumed to be FIFO, /dev/null etc.
            continue
        if path in seen:
            raise CommandLineError(
                f"Path {path} specified more than once as an output file. "
                f"This is not supported at the moment."
            )
        seen.add(path)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…