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.

classification
Title: diffutil errors when comparing 2 0 byte entries
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, brett.cannon, rzigweid
Priority: normal Keywords:

Created on 2004-06-25 15:12 by rzigweid, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg21303 - (view) Author: Robert M. Zigweid (rzigweid) Date: 2004-06-25 15:12
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
msg21304 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2004-06-26 03:17
Logged In: YES 
user_id=12800

Probably a dup of 980117
msg21305 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2004-07-10 23:55
Logged In: YES 
user_id=357491

Fixed in rev. 1.21 in CVS.  Not backporting in case someone actually 
relies on this behavior.
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40453
2004-06-25 15:12:32rzigweidcreate