Provide the canonical form of the path suitable for storing in the database.
(path: PathLike)
| 172 | |
| 173 | |
| 174 | def normpath(path: PathLike) -> bytes: |
| 175 | """Provide the canonical form of the path suitable for storing in |
| 176 | the database. |
| 177 | """ |
| 178 | str_path = syspath(path, prefix=False) |
| 179 | str_path = os.path.normpath(os.path.abspath(os.path.expanduser(str_path))) |
| 180 | return bytestring_path(str_path) |
| 181 | |
| 182 | |
| 183 | def ancestry(path: AnyStr) -> list[AnyStr]: |