This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris.jerdonek
Recipients chris.jerdonek
Date 2012-07-26.00:00:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343260803.75.0.101432828571.issue15450@psf.upfronthosting.co.za>
In-reply-to
Content
Currently, the subdirs attribute of filecmp.dircmp does not respect subclassing:

>>> from filecmp import dircmp
>>> class MyDirCmp(dircmp):
...   pass
... 
>>> my_dcmp = MyDirCmp('dir1', 'dir2')
>>> for item in my_dcmp.subdirs.values():
...   print(type(item))
...   break
... 
<class 'filecmp.dircmp'>

This is the only place where dircmp does not respect subclassing.  It can be corrected here:

def phase4(self): # Find out differences between common subdirectories
    ...
        ...
        self.subdirs[x]  = dircmp(a_x, b_x, self.ignore, self.hide)

This would let one do things like override dircmp.report() and have dircmp.report_full_closure() behave as expected.
History
Date User Action Args
2012-07-26 00:00:03chris.jerdoneksetrecipients: + chris.jerdonek
2012-07-26 00:00:03chris.jerdoneksetmessageid: <1343260803.75.0.101432828571.issue15450@psf.upfronthosting.co.za>
2012-07-26 00:00:03chris.jerdoneklinkissue15450 messages
2012-07-26 00:00:02chris.jerdonekcreate