[issue22276] pathlib glob ignores trailing slash in pattern

Andrei Kulakov report at bugs.python.org
Sat Nov 20 21:47:05 EST 2021


Andrei Kulakov <andrei.avk at gmail.com> added the comment:

Generally if Path is created with a trailing separator, I think it should error out for all methods that apply to files, for example `.touch()`, `read*()`, `write*()`, others.

This is consistent with shell commands:

touch xyz/                                                                       touch: xyz/: Not a directory 

echo 'blah' > xyz/                                                               
zsh: not a directory: xyz/

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue22276>
_______________________________________


More information about the Python-bugs-list mailing list