New PR up here: https://github.com/python/cpython/pull/26153
The correspondence between `pathlib` and `os.path` is as follows:
- `Path.resolve()` is roughly `os.path.realpath()`
- `Path.absolute()` is roughly `os.path.abspath()`
Differences:
- `resolve()` always raises RuntimeError on symlink loops, whereas `realpath()` either raises OSError or nothing depending on *strict*.
- `absolute()` doesn't normalize the path, whereas `abspath()` does. Normalizing without resolving symlinks can change the meaning of the path, so pathlib does the better thing here. |