Newbie question on 'cmpfiles':

Oldayz sill at localhost.kitenet.net
Wed Dec 6 18:35:29 EST 2000


On Wed, 6 Dec 2000 21:05:31 +1100, Srihari Vijayaraghavan <harisri at bigpond.com> wrote:
>Oldayz wrote:
>
>> On Tue, 05 Dec 2000 05:59:02 GMT, harisri at my-deja.com
>> <harisri at my-deja.com> wrote:

>Hello Andrei,
>
>Thanks. However I am having some problem while using "dircmp" class.
>
>I have the following 2 (identical) directories under my home directory: 
>/home/hari/python1 and /home/hari/python2. 
>
>I am getting few error messages, only while using the following attributes: 
>diff_files, report(), report_partial_closure(), and report_full_closure().
>
>I am enclosing the error messages for your reference. Am I doing something 
>wrong?
>
>Python 2.0 (#1, Oct 16 2000, 18:10:03)
>[GCC 2.95.2 19991024 (release)] on linux2
>Type "copyright", "credits" or "license" for more information.
>>>> from filecmp import *
>>>> x=dircmp("/home/hari/python1", "/home/hari/python2")
>>>> x.left_list
>['about.html', 'acks.html', 'api', 'dist', 'doc', 'ext', 'icons', 
>'index.html',
>'inst', 'lib', 'mac', 'modindex.html', 'ref', 'tut']
>>>> x.right_list
>['about.html', 'acks.html', 'api', 'dist', 'doc', 'ext', 'icons', 
>'index.html',
>'inst', 'lib', 'mac', 'modindex.html', 'ref', 'tut']
>>>> x.common
>['ref', 'ext', 'acks.html', 'inst', 'api', 'mac', 'about.html', 
>'modindex.html', 'tut', 'doc', 'icons', 'lib', 'dist', 'index.html']
>>>> x.left_only
>[]
>>>> x.right_only
>[]
>>>> x.common_dirs
>['ref', 'ext', 'inst', 'api', 'mac', 'tut', 'doc', 'icons', 'lib', 'dist']
>>>> x.common_files
>['acks.html', 'about.html', 'modindex.html', 'index.html']
>>>> x.same_files
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "/usr/local/lib/python2.0/filecmp.py", line 147, in __getattr__
>    self.phase3()
>  File "/usr/local/lib/python2.0/filecmp.py", line 214, in phase3
>    xx = cmpfiles(self.left, self.right, self.common_files)
>  File "/usr/local/lib/python2.0/filecmp.py", line 288, in cmpfiles
>    res[_cmp(ax, bx, shallow, use_statcache)].append(x)
>TypeError: too many arguments; expected 2, got 4                            
>>>> x.report()
>diff /home/hari/python1 /home/hari/python2
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "/usr/local/lib/python2.0/filecmp.py", line 241, in report
>    if self.same_files:
>  File "/usr/local/lib/python2.0/filecmp.py", line 147, in __getattr__
>    self.phase3()
>  File "/usr/local/lib/python2.0/filecmp.py", line 214, in phase3
>    xx = cmpfiles(self.left, self.right, self.common_files)
>  File "/usr/local/lib/python2.0/filecmp.py", line 288, in cmpfiles
>    res[_cmp(ax, bx, shallow, use_statcache)].append(x)
>TypeError: too many arguments; expected 2, got 4                            
> >>> x.report_partial_closure()
>diff /home/hari/python1 /home/hari/python2
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "/usr/local/lib/python2.0/filecmp.py", line 258, in 
>report_partial_closure
>    self.report()
>  File "/usr/local/lib/python2.0/filecmp.py", line 241, in report
>    if self.same_files:
>  File "/usr/local/lib/python2.0/filecmp.py", line 147, in __getattr__
>    self.phase3()
>  File "/usr/local/lib/python2.0/filecmp.py", line 214, in phase3
>    xx = cmpfiles(self.left, self.right, self.common_files)
>  File "/usr/local/lib/python2.0/filecmp.py", line 288, in cmpfiles
>    res[_cmp(ax, bx, shallow, use_statcache)].append(x)
>TypeError: too many arguments; expected 2, got 4
>>>> x.report_full_closure()
>diff /home/hari/python1 /home/hari/python2
>Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
>  File "/usr/local/lib/python2.0/filecmp.py", line 264, in 
>report_full_closure
>    self.report()
>  File "/usr/local/lib/python2.0/filecmp.py", line 241, in report
>    if self.same_files:
>  File "/usr/local/lib/python2.0/filecmp.py", line 147, in __getattr__
>    self.phase3()
>  File "/usr/local/lib/python2.0/filecmp.py", line 214, in phase3
>    xx = cmpfiles(self.left, self.right, self.common_files)
>  File "/usr/local/lib/python2.0/filecmp.py", line 288, in cmpfiles
>    res[_cmp(ax, bx, shallow, use_statcache)].append(x)
>TypeError: too many arguments; expected 2, got 4                            
>    
>Thanks in advance,
>
>Hari.      

According to 
http://sourceforge.net/bugs/?group_id=5470&func=detailbug&bug_id=124120 
this is a known bug and it can be fixed by applying the latest patch, which 
you can get at 
http://sourceforge.net/patch/?func=detailpatch&patch_id=102628&group_id=5470

-- 
Hope this helps,

	Andrei



More information about the Python-list mailing list