[issue28718] '*' matches entire path in fnmatch

2019-03-31 Thread Toon Verstraelen


Toon Verstraelen  added the comment:

Just for reference, here are a few more implementations of the same idea, next 
to pywildcard, sometimes combined with other useful features:

- https://github.com/LawfulHacker/fnmatch2
- https://github.com/demurgos/py-pathmatch
- https://github.com/vidartf/globmatch
- https://github.com/facelessuser/wcmatch

The last one is rather active, with regular releases, last one on March 24, 
2019.

--

___
Python tracker 

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



[issue28718] '*' matches entire path in fnmatch

2019-03-28 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28718] '*' matches entire path in fnmatch

2019-03-28 Thread Toon Verstraelen


Toon Verstraelen  added the comment:

For consistency with the corresponding feature in the glob function since 
Python 3.5, I would suggest to add an extra optional argument 'recursive' 
instead of 'glob_asterisks'. With the default recursive=False, one gets the old 
behavior, with recursive=True, it can handle the '**' and '*' as in pywildcard.

I realize that with recursive=False, the behavior is not exactly consistent 
with glob, but  I'd still prefer the same name for the optional argument. It is 
the common terminology for this type of feature. See 
https://en.wikipedia.org/wiki/Matching_wildcards

--
nosy: +Toon Verstraelen

___
Python tracker 

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



[issue28718] '*' matches entire path in fnmatch

2017-12-08 Thread Alberto Galera

Alberto Galera  added the comment:

I see that they have commented on the lib that I made a few years ago 
(python-wildcard).

The reason for the creation of that little fork started in this issue:

https://bugs.python.org/issue25734

--
nosy: +Alberto Galera

___
Python tracker 

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



[issue28718] '*' matches entire path in fnmatch

2017-03-27 Thread Aaron Whitehouse

Aaron Whitehouse added the comment:

Posted to the [Python-ideas] mailing list, as it is proposing a change to a 
standard library:
https://mail.python.org/pipermail/python-ideas/2017-February/044880.html

Nobody has responded so far, however. I take this as at least no vehement 
objection to the idea.

--

___
Python tracker 

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



[issue28718] '*' matches entire path in fnmatch

2017-02-26 Thread Aaron Whitehouse

Aaron Whitehouse added the comment:

Note that somebody has forked the standard library to implement this:
https://github.com/kianxineki/python-wildcard
This shows that the actual changes would be pretty small (though pywildcard is 
based on 2.x code and does not handle the cross-platform slashes you have been 
discussing).

It is also worth noting that the glob standard library:
https://docs.python.org/3.7/library/glob.html
implements a "recursive" option that has similar behaviour (* does not span 
path separators whereas ** does) and essentially builds this on top of fnmatch 
for the actual filename matching. 

I do not think we can change the default behaviour of fnmatch at this point, 
but I would like to see this behaviour triggered by an optional argument to the 
various functions, e.g.:
fnmatch.fnmatch(filename, pattern, glob_asterisks=False)
fnmatch.fnmatchcase(filename, pattern, glob_asterisks=False)
fnmatch.filter(names, pattern, glob_asterisks=False)
fnmatch.translate(pattern, glob_asterisks=False)

In each case, if glob_asterisks (or whatever other name we came up with) is 
true, the behaviour would match the pywildcard behaviour, i.e.:
**  matches everything
*   matches in one path level

I look after the glob matching code in duplicity and would like to start using 
the standard library to do filename matching for us, but we need the above 
behaviour. I am happy to do the patching if there is a realistic chance of it 
being accepted.

--
nosy: +aaron-whitehouse
title: '*' matches entire path in fnmatch.translate -> '*' matches entire path 
in fnmatch

___
Python tracker 

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