[ python-Bugs-979794 ] diffutil errors when coparing 2 0 byte entries

SourceForge.net noreply at sourceforge.net
Fri Jun 25 11:12:32 EDT 2004


Bugs item #979794, was opened at 2004-06-25 11:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=979794&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Robert M. Zigweid (rzigweid)
Assigned to: Nobody/Anonymous (nobody)
Summary: diffutil errors when coparing 2 0 byte entries

Initial Comment:
difflib has a problem where if the two things that it is comparing are 
0 byte/null that when it comes time to output the results, it errors 
because a generator appears to not be properly set up.

To duplicate easily, use the diff.py utility in Tools/scripts and diff 
two zero byte files. 

This error does not occur if either of the objects being compared has 
content.


  File "diff.py", line 40, in ?
    sys.stdout.writelines(diff)
  File "/usr/local/lib/python2.3/difflib.py", line 1215, in context_diff
    for group in 
SequenceMatcher(None,a,b).get_grouped_opcodes(n):
  File "/usr/local/lib/python2.3/difflib.py", line 574, in 
get_grouped_opcodes
    if codes[0][0] == 'equal':
IndexError: list index out of range


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=979794&group_id=5470



More information about the Python-bugs-list mailing list