[issue41560] pathlib.Path.glob fails on empty string

Alexander Heger report at bugs.python.org
Tue Aug 18 00:34:00 EDT 2020


Alexander Heger <alex.heger at gmail.com> added the comment:

In my code, having been translated form use of `os.path` to `pathlib.Path` the change in behaviour caused errors and required significant refactoring.  

Why not just return the empty list if there is no match, as is done in other cases when there is no match, except when passing the empty string.  For example, in my case, the base path already refers to a potentially existing file[name] and I then "glob" for appendices to the filename or suffices (or neither or both).  So in this case the glob for empty strong would just return the file if it exists.

----------

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


More information about the Python-bugs-list mailing list