[issue31123] fnmatch does not follow Unix fnmatch functionality

2017-08-08 Thread R. David Murray

R. David Murray added the comment:

That seems like a reasonable use case, but is fnmatch what git is using for 
this?  If so, what is the feature set required?  In any case, the existing 
functionality must remain as is for backward compatibility reasons, so this 
would either be a new function or keyword controlled optional behavior.

(You will note that our fnmatch documentation specifically mentions treating / 
as a normal character.)

--

___
Python tracker 

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



[issue31123] fnmatch does not follow Unix fnmatch functionality

2017-08-07 Thread Varun Agrawal

Varun Agrawal added the comment:

Hi David,
It seems you already took a look at the man page. There are some subtle 
differences such as being unable to match to a directory when the pattern ends 
with a forward slash.
Overall, I'd like to see fnmatch be used to create a program that can perform 
pattern matching of files similar to how a gitignore works. Currently, this 
involves quite a bit of hackery to get working well.

--

___
Python tracker 

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



[issue31123] fnmatch does not follow Unix fnmatch functionality

2017-08-04 Thread R. David Murray

R. David Murray added the comment:

Looking at the fnmatch man page, it looks like there are option flags that some 
shells use that our fnmatch doesn't support.  I'm not sure if supporting them 
is a good idea for us or not, but it is probably worth discussing.  I suspect 
our fnmatch was implemented before gnu added those extensions.

--

___
Python tracker 

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



[issue31123] fnmatch does not follow Unix fnmatch functionality

2017-08-04 Thread R. David Murray

Changes by R. David Murray :


--
type: behavior -> enhancement
versions:  -Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue31123] fnmatch does not follow Unix fnmatch functionality

2017-08-04 Thread R. David Murray

R. David Murray added the comment:

I don't believe there is an equivalent unix command.  Are you referring to the 
fnmatch glibc function?  Can you demonstrate the differences?  I doubt we will 
change the functionality, but that would be the minimum starting point for a 
discussion.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31123] fnmatch does not follow Unix fnmatch functionality

2017-08-04 Thread Varun Agrawal

New submission from Varun Agrawal:

Currently, the fnmatch module in Python does not operate like the Unix 
equivalent command. This is especially the case with patterns such as `dir/` 
which does not match directory path returned by `os` (which would be `dir`) and 
neither does the pattern match the underlying files and sub-directories. Adding 
these functionalities so that fnmatch matches it's Unix equivalent would make 
it much more powerful to use.

Glob is not useful since glob is a special case that matches only with the 
current directory paths rather than the a general purpose filename pattern 
matcher.

--
components: Library (Lib)
messages: 299763
nosy: Varun Agrawal
priority: normal
severity: normal
status: open
title: fnmatch does not follow Unix fnmatch functionality
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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