windows#

Common Windows path utilities.

Functions#

win_path_ok(path)

win_path_double_escape(path)

win_path_backout(path)

_path_to(→ str | tuple[str, Ellipsis] | None)

win_path_to_unix(→ str | tuple[str, Ellipsis] | None)

Convert Windows paths to Unix paths.

unix_path_to_win(→ str | tuple[str, Ellipsis] | None)

Convert Unix paths to Windows paths.

win_path_ok(path)#
win_path_double_escape(path)#
win_path_backout(path)#
_path_to(paths: conda.common.path.PathType | conda.common.path.PathsType | None, prefix: conda.common.path.PathType | None = None, *, cygdrive: bool, to_unix: bool) str | tuple[str, Ellipsis] | None#
win_path_to_unix(paths: conda.common.path.PathType | conda.common.path.PathsType | None, prefix: conda.common.path.PathType | None = None, *, cygdrive: bool = False) str | tuple[str, Ellipsis] | None#

Convert Windows paths to Unix paths.

Note

Produces unexpected results when run on Unix.

Parameters:
  • paths -- The path(s) to convert.

  • prefix -- The (Windows path-style) prefix directory to use for the conversion. If not provided, no checks for prefix paths will be made.

  • cygdrive -- Whether to use the Cygwin-style drive prefix.

unix_path_to_win(paths: conda.common.path.PathType | conda.common.path.PathsType | None, prefix: conda.common.path.PathType | None = None, *, cygdrive: bool = False) str | tuple[str, Ellipsis] | None#

Convert Unix paths to Windows paths.

Note

Produces unexpected results when run on Unix.

Parameters:
  • paths -- The path(s) to convert.

  • prefix -- The (Windows path-style) prefix directory to use for the conversion. If not provided, no checks for prefix paths will be made.

  • cygdrive -- Unused. Present to keep the signature consistent with win_path_to_unix.