Andrei Kulakov <[email protected]> added the comment:
I have also run into this when looking into path.glob('dangling_symlink') issue.
I can add a few things (in the examples, *myfile* is a file, not a directory):
This is probably more common / less obscure than '*/':
path.glob('myfile/') => True
This is inconsistent with how shell `ls` command works and with glob.glob() and
looks wrong.
Path('myfile/').exists() => True
Path('myfile/') == Path('myfile') => True
str(Path('myfile/')) => 'myfile'
You can compare this to behavior of `ls` (tested on MacOS):
ls myfile
myfile
ls myfile/
ls: myfile/: Not a directory
I think many users will expect behavior consistent with `ls` and `glob.glob`.
I've used `ls` in this manner before.
----------
nosy: +andrei.avk
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue22276>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com