Skip to content

Paths should be path objects and not just concatenated strings #240

@dnowacki-usgs

Description

@dnowacki-usgs

Currently we write paths as something like "your/path/goes/here".

And then modify paths by doing something like

    basefile = metadata["basefile"]

    if "prefix" in metadata:
        basefile = metadata["prefix"] + basefile

Those are string paths that we are concatenating using the addition operator.

This is not ideal, since it may be confusing to Windows users (who are used to seeing backslash-separated paths), the current method is not obvious, and because Python provides a more robust method of dealing with paths. We should consider using os.path or probably better, pathlib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions