Barney Gale <barney.g...@gmail.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue29688>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to