[Python-ideas] PEP 428 - object-oriented filesystem paths

Antoine Pitrou solipsis at pitrou.net
Sun Oct 14 19:53:26 CEST 2012


On Sun, 14 Oct 2012 08:48:53 -0700
Ethan Furman <ethan at stoneleaf.us> wrote:
> 
> What behavior can I expect with your Path implementation when I try to 
> iterate over
> 
> /usr/home/ethanf/some_table.dbf

>>> p = Path('setup.py')
>>> list(p)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "./pathlib.py", line 1176, in __iter__
    for name in self._accessor.listdir(self):
  File "./pathlib.py", line 455, in wrapped
    return strfunc(str(pathobj), *args)
NotADirectoryError: [Errno 20] Not a directory: 'setup.py'


Regards

Antoine.





More information about the Python-ideas mailing list