Jason R. Coombs <jar...@jaraco.com> added the comment:
The problem with the `__fspath__` protocol is that it assumes a file system. The `importlib.resources` and `Traversable` protocols are trying to provide a lower-level interface that doesn't assume a file system. Fortunately, there already exists a helper function `as_file` (https://docs.python.org/3/library/importlib.html#importlib.resources.as_file) that's meant to provide the user experience that `path` once provided, but for Traversable files. Does that satisfy the need you've identified? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44200> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com