This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author daveraja
Recipients daveraja, eric.smith
Date 2021-10-11.10:03:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1633946603.15.0.078947601516.issue45427@roundup.psfhosted.org>
In-reply-to
Content
Thanks for the quick response. I think the attached file shows the issue. 

In the directory where you download and run this file create a sub-directory 'data'. Then running the file creates the output (note: I've truncated the path name):

> Traverse data: MultiplexedPath('<<abspath-deleted>>/data') (<class 'importlib.readers.MultiplexedPath'>)

I think the idea behind MultiplexedPath() is that it merges together multiple base/root directories so even though in this case it is a single path it wouldn't necessarily be the case in general. So while it makes sense that for some MultiplexedPath object X that str(X) isn't itself a proper directory path, however, there seems to be no method/property to access these root paths.

Note: Traverable.iterdir() iterates over the files/sub-directories in the root(s) so doesn't return the root path(s) themselves.

A further note. If you add a file `data/__init__.py` then data is now a package and running the code this time returns a PosixPath object (on a posix system): 

> Traverse data: <<abspath-deleted>>/data (<class 'pathlib.PosixPath'>)
> X: <<abspath-deleted>>/data/__init__.py (<class 'pathlib.PosixPath'>)
> X: <<abspath-deleted>>/data/__pycache__ (<class 'pathlib.PosixPath'>)
History
Date User Action Args
2021-10-11 10:03:23daverajasetrecipients: + daveraja, eric.smith
2021-10-11 10:03:23daverajasetmessageid: <1633946603.15.0.078947601516.issue45427@roundup.psfhosted.org>
2021-10-11 10:03:23daverajalinkissue45427 messages
2021-10-11 10:03:23daverajacreate