Nikolaus Rath added the comment:
I don't think that we can just introduce path normalization in phase0. Even
though I agree that this would be the proper way to do it when reimplementing
from scratch, it breaks backward compatibility.
There also is a small mistake in that the *match*
Changes by Mark Lawrence breamore...@yahoo.co.uk:
--
nosy: -BreamoreBoy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1738
___
___
Mark Lawrence breamore...@yahoo.co.uk added the comment:
Patch worked fine with 2.7. I reworked it for SVN trunk but got this failure.
FAILED (failures=1)
Traceback (most recent call last):
File test_filecmp.py, line 179, in module
test_main()
File test_filecmp.py, line 176, in
Changes by Alexander Belopolsky belopol...@users.sourceforge.net:
--
assignee: belopolsky -
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1738
___
Changes by Terry J. Reedy tjre...@udel.edu:
--
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1738
___
Changes by Terry J. Reedy tjre...@udel.edu:
--
versions: -Python 2.6, Python 2.7, Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1738
___
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
The patch does not apply to py3k branch.
--
assignee: - belopolsky
stage: - needs patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1738
Michael Amrhein [EMAIL PROTECTED] added the comment:
Here's a 2nd revised patch, which
* adds a keyword 'match' to the constructor of class 'dircmp'
* defaults 'match' to str.__eq__
* modifies method 'phase0': apply os.name.normcase to each name in
ignore and hide
* modifies the docs
Michael Amrhein [EMAIL PROTECTED] added the comment:
There is one small issue I would like to discuss:
While the comparison of directory and file names in phase1 is
case-insensitive on case-insensitive systems (os.path.normcase applied
to each name), the filtering of ignore and hide in phase0
Michael Amrhein [EMAIL PROTECTED] added the comment:
Alexander Belopolsky [EMAIL PROTECTED] added the comment:
...
'*' is a perfectly legal filename character on most filesystems
Oops! Never thought of putting a '*' into a file name.
Obviously, I should have tried before ...
Ok, then I
Michael Amrhein [EMAIL PROTECTED] added the comment:
I've implemented an enhanced version of this feature by adding a keyword
'match' to the constructor of class 'dircmp'. It defaults to function
'fnmatch' imported from module 'fnmatch'.
This allows to exclude directories and/or files by using
Alexander Belopolsky [EMAIL PROTECTED] added the comment:
+1 on adding the match argument. Can you comment on how one would
implement the old behavior? I would guess match=lambda x,y: x in y,
which is not that bad, but maybe that should be the default and those
who need pattern matching
Michael Amrhein [EMAIL PROTECTED] added the comment:
Ok, I've set default arguments (back) to None. Revised patch attached.
Defaulting the match function to fnmatch doesn't change the behavior in
the normal case, i.e. when regular file / directory names are used,
like in the default value of
Alexander Belopolsky [EMAIL PROTECTED] added the comment:
As you are working on this, please consider changing
self.hide+self.ignore in phase0 to chain(self.hide, self.ignore) where
chain should be imported from itertools. There is no need to create the
combined list (twice!) and not accepting
Sean Reifschneider [EMAIL PROTECTED] added the comment:
Please also include at least documentation changes, since this changes
the behavior of the module. This would be in the file:
Doc/library/filecmp.rst
Also. If possible a test would be great. The file for this would be:
Virgil Dupras added the comment:
The documentation doesn't say anything about dircmp being supposed to
support pattern matching. This ticket is a feature request rather than a
bug.
--
components: +Library (Lib) -None
nosy: +vdupras
type: behavior - feature request
Changes by Georg Brandl:
Removed file: http://bugs.python.org/file9067/filecmp.py.patch
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1738
__
___
Python-bugs-list mailing list
New submission from Oliver Nelson:
dircmp's ignore and hide list only take exact files to ignore, not unix
filename pattern's. This means you can't hide/ignore *.bak or something
similar. Changing the _filter function adds this:
def newfilter(flist, skip):
for pattern in skip:
flist =
Changes by Oliver Nelson:
--
components: None
nosy: flxkid
severity: normal
status: open
title: filecmp.dircmp does exact match only
type: behavior
versions: Python 2.5
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1738
Guido van Rossum added the comment:
I'm sorry, but can you rephrase that in the form of a patch? I can't
quite figure out what you're trying to say, except that it sounds like
it's scratching an itch of yours.
--
nosy: +gvanrossum
__
Tracker [EMAIL
Oliver Nelson added the comment:
Patch attached (sorry, this is my first bug report on an os project).
dircmp has a list of files to ignore and hide. These lists right now
are compared to the left and right lists using __contains__ to filter
out the ignore/hide lists.
This patch adds the
Oliver Nelson added the comment:
sorry...jacked up the patch file...new one attached
Added file: http://bugs.python.org/file9068/filecmp.py.patch
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1738
__
22 matches
Mail list logo