Return a cleaned and normalized POSIX ``path``.
(path)
| 1643 | |
| 1644 | |
| 1645 | def clean_path(path): |
| 1646 | """ |
| 1647 | Return a cleaned and normalized POSIX ``path``. |
| 1648 | """ |
| 1649 | path = path or "" |
| 1650 | # convert to posix and ensure we have no slash at the end |
| 1651 | path = posixpath_normpath(path.replace("\\", "/").rstrip("/")) |
| 1652 | if path == ".": |
| 1653 | path = "" |
| 1654 | return path |
| 1655 | |
| 1656 | |
| 1657 | def strip_first_path_segment(path): |
no test coverage detected