[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 programs). Though you might also consider how easy it 
would be to write a wrapper function around Path.glob() that implements this.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 of being hidden is that it should not be 
included in globbing. One marks a file or directory to be hidden specifically 
to mean 'do not include this one when selecting groups of files or directories'.

Once the glob string has been expanded, it is possible to filter out the hidden 
files and directories, but it very difficult to do so if there are several 
levels of directories because one has to look for hidden items at all levels of 
the path.

Globbing has been available and largely unchanged for almost 50 years. I am not 
the one that is asking for it to be changed. I am asking for it to be returned 
to what it has always been. Being consistent with bash and other shells is a 
very important feature. It allows us to offer pathlib globbing to the end user 
and have it work the way they expect.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 think we would also welcome adding a walk() method to pathlib. But let's 
please leave glob() alone.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 bug
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 '.'.

--
messages: 258128
nosy: jitterman
priority: normal
severity: normal
status: open
title: '*' glob string matches dot files in pathlib
type: behavior
versions: Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com