New submission from David Rajaratnam <da...@gemarex.com.au>:

I'm trying to use `importlib.resources.files()`. However, I cannot work out how 
to properly use the `importlib.readers.MultiplexedPath()` object that is 
returned.

As I expect and want, the returned object is referring to a directory, but I 
cannot seem to simply access the value of that path. 

For a normal `pathlib.Path` object you can get a OS specific path by simply 
converting to the string representation (eg., 'str(pathlib.Path('/somepath') == 
'/somepath'). However, for the MutiplexedPath object the __str__() value is the 
same as the __repr__() (e.g., "MultiplexedPath('/somepath')").

It seems that this is a bug since I would expect MultiplexedPath to behave the 
same as pathlib.Path in this regard. In the meantime is there a way to actually 
access this data without stripping the prefix and suffix of this string?

----------
components: Library (Lib)
messages: 403621
nosy: daveraja
priority: normal
severity: normal
status: open
title: importlib.readers.MultiplexedPath
type: behavior
versions: Python 3.10

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

Reply via email to