Eric V. Smith <e...@trueblade.com> added the comment: Path.parents will do what you want. I don't have a Windows box handy, but this is on MacOS:
>>> from pathlib import Path >>> p = >>> Path("/Users/User/AppData/Local/Programs/Python/Python36/Lib/asyncio/__init__.py") >>> p.parents[1] PosixPath('/Users/User/AppData/Local/Programs/Python/Python36/Lib') >>> ---------- nosy: +eric.smith _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33102> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com