[issue26096] '*' glob string matches dot files in pathlib

2016-02-07 Thread Guido van Rossum
Guido van Rossum added the comment: If you really need an easy way to provide what the shell offers to end users, maybe you could submit a patch that adds an option similar to "GLOBIGNORE" in bash (but the default would be to return everything, which is more regular and more useful for Python

[issue26096] '*' glob string matches dot files in pathlib

2016-02-03 Thread JitterMan
JitterMan added the comment: Globbing has been with us for almost 50 years, and in all that time it has never matched the hidden files/directories. There may be isolated cases where matching the hidden items is preferred, but generally that is not the case. Indeed, the primary characteristic

[issue26096] '*' glob string matches dot files in pathlib

2016-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: If you have that use case you're probably better of using os.walk() so you are not limited to a prune strategy that can be expressed using a single glob pattern (e.g. maybe I want to ignore .git, .hg and __pycache__ but descend into everything else). I

[issue26096] '*' glob string matches dot files in pathlib

2016-01-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm frankly not sure that's a bug. If you want to filter out dotfiles, it is quite easy to do yourself. On the other hand, if pathlib always filtered them out, it would be more cumbersome to get a unified set of results with both dotfiles and non-dotfiles.

[issue26096] '*' glob string matches dot files in pathlib

2016-01-14 Thread Guido van Rossum
Guido van Rossum added the comment: I've thought about this too, and I've decided it's a feature. As Antoine says, it's easy enough to filter the dot files out if you don't want them; it's slightly complicated to include them if the default is to skip them. -- resolution: -> not a

[issue26096] '*' glob string matches dot files in pathlib

2016-01-14 Thread SilentGhost
Changes by SilentGhost : -- components: +Library (Lib) nosy: +gvanrossum, pitrou versions: +Python 3.6 -Python 3.4 ___ Python tracker

[issue26096] '*' glob string matches dot files in pathlib

2016-01-12 Thread JitterMan
New submission from JitterMan: Path('.').glob('*') generates all files and directories in '.' including hidden files (those that begin with '.'). This behavior is inconsistent with the shell and with the old glob module, which only generate hidden files if the glob pattern starts with a '.'.