Issue 12932: filecmp.dircmp does not allow non-shallow comparisons (original) (raw)

Created on 2011-09-07 16:01 by kesmit, last changed 2022-04-11 14:57 by admin.

Files
File name Uploaded Description Edit
issue12932.diff planet36,2013-06-14 21:24 Add input parameter 'shallow' to dircmp. review
Messages (9)
msg143692 - (view) Author: Kevin Smith (kesmit) Date: 2011-09-07 16:01
While filecmp.cmp and filecmp.cmpfiles allow a shallow option to be specified to invoke a more involved comparison of files, filecmp.dircmp does not. It is limited to shallow-only comparisons. This could be solved quite easily by adding a shallow keyword option to dircmp then changing the phase3 method to the following. def phase3(self): # Find out differences between common files xx = cmpfiles(self.left, self.right, self.common_files, self.shallow) self.same_files, self.diff_files, self.funny_files = xx
msg156736 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-03-25 06:59
Thanks for the report. Unfortunately 2.7 is closed to new features and the module is removed in 3.x, so there is nothing to do here.
msg160966 - (view) Author: Lennart Regebro (lregebro) Date: 2012-05-17 12:05
filecmp is still there in Python 3.3 Alpha 3. I can't find any reference to it being deprecated.
msg161823 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-05-29 00:34
Lennart, I saw your response on StackOverflow ;-).
msg164648 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-07-04 14:41
+1 for this. Whether or not this feature is implemented, I think the documentation should state that directory comparisons are done using "shallow=True". I created issue 15250 for this.
msg166246 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2012-07-23 19:55
Allowing dircmp() to accept a file comparison function is another option to consider that may address more needs going forward. shallow=False could be achieved by passing lambda a, b: filecmp.cmp(a, b, shallow=False).
msg191154 - (view) Author: Steve Ward (planet36) Date: 2013-06-14 21:24
Add input parameter 'shallow' to dircmp. Use it in phase3 and phase4. Document it in filecmp.rst. Did not modify test_filecmp.py.
msg247695 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2015-07-30 20:50
Thanks for the patch @planet36, however I think this is sufficiently large a change that we should also have a test case for it. I'm also retargeting this to the current open branches for feature work - 3.6.
msg247696 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2015-07-30 20:51
Bah, wrong stage. patch review.
History
Date User Action Args
2022-04-11 14:57:21 admin set github: 57141
2018-01-03 09:42:28 mitar set nosy: + mitar
2015-07-30 20:51:20 rbcollins set messages: + stage: test needed -> patch review
2015-07-30 20:50:14 rbcollins set versions: + Python 3.6, - Python 3.4nosy: + rbcollinsmessages: + stage: commit review -> test needed
2015-04-09 21:04:55 r.david.murray set stage: needs patch -> commit review
2013-06-14 21:24:17 planet36 set files: + issue12932.diffkeywords: + patchmessages: +
2013-06-06 19:52:11 planet36 set nosy: + planet36
2012-07-23 19:55:29 chris.jerdonek set messages: + versions: + Python 3.4, - Python 3.3
2012-07-04 14:41:23 chris.jerdonek set nosy: + chris.jerdonekmessages: +
2012-06-01 17:58:23 eric.araujo set title: dircmp does not allow non-shallow comparisons -> filecmp.dircmp does not allow non-shallow comparisonsstage: test needed -> needs patch
2012-05-29 00:34:35 terry.reedy set status: closed -> openversions: + Python 3.3, - Python 2.6, Python 2.7nosy: + terry.reedymessages: + resolution: out of date -> stage: resolved -> test needed
2012-05-17 12:05:52 lregebro set nosy: + lregebromessages: +
2012-03-25 06:59:24 eric.araujo set status: open -> closednosy: + eric.araujomessages: + resolution: out of datestage: resolved
2011-09-07 16:01:35 kesmit create