Skip to content

Refactor: Migrate os.path to pathlib.Path in file_processor_handler.py #68757

@Dotify71

Description

@Dotify71

Description

The airflow.utils.log.file_processor_handler module currently relies heavily on the os.path library for filesystem path manipulations.

To modernize the codebase, improve cross-platform readability, and align with modern Python standards, we should migrate these os.path calls (e.g., os.path.join, os.path.abspath, os.path.isdir) to their pathlib.Path equivalents.

Use case/motivation

Modernizing file_processor_handler.py improves readability and type safety by treating paths as objects rather than strings, which aligns with Airflow's broader goals of modernizing its Python codebase.

Related issues

None

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions