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

2021-10-18 Thread Irit Katriel
Irit Katriel added the comment: path.glob() returns a generator now, but the contents are still this exception: >>> from pathlib import Path >>> path = Path('./myfile.txt') >>> >>> path.glob('') >>> list(path.glob('')) Traceback (most recent call last): File "", line 1, in File

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

2020-08-19 Thread Jeffrey Kintscher
Change by Jeffrey Kintscher : -- nosy: +Jeffrey.Kintscher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2020-08-18 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

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

2020-08-17 Thread Alexander Heger
Alexander Heger 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

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

2020-08-17 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > This is not the desired or expected behaviour, which would be to just return > `path` if it exists. That's the expected behaviour if the call is successful (it does not violate any pre-condition. > This behaviour is also inconsistent with the

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

2020-08-15 Thread Alexander Heger
New submission from Alexander Heger : Passing an empty string to pathlib.Path.glob fails. Example ``` from pathlib import Path path = Path('./myfile.txt') path.glob('') ``` The result is: ``` ~/Python/lib/python3.8/pathlib.py in glob(self, pattern) 1129 """ 1130 if not