python 2.3 exception with empty file

Erik Toubro Nielsen erik at
Sun Mar 27 20:46:45 BST 2005

When using python-2.3.4 (python-2.3.4-3.2.rpm on SuSE9.2) and doing:
   mkdir d.test-empty
   cd d.test-empty
   bzr init
   touch empty.txt
   bzr add empty.txt
   bzr diff
This exception happens:
   bzr: exception: list index out of range
       see .bzr.log for details
   Traceback (most recent call last):
     File "/home/erik/work/mybazaar/bzrlib/", line 773, in main
       ret = run_bzr(argv)
     File "/home/erik/work/mybazaar/bzrlib/", line 759, in run_bzr
       ret = cmd_handler(**cmdargs) or 0
     File "/home/erik/work/mybazaar/bzrlib/", line 310, in cmd_diff
       tofile=new_label + new_name + idlabel)
     File "/home/erik/work/mybazaar/bzrlib/", line 298, in diffit
       sys.stdout.writelines(difflib.unified_diff(*a, **kw))
     File "/usr/lib/python2.3/", line 1149, in unified_diff
       for group in SequenceMatcher(None,a,b).get_grouped_opcodes(n):
     File "/usr/lib/python2.3/", line 574, in get_grouped_opcodes
       if codes[0][0] == 'equal':
   IndexError: list index out of range

Copying from Python-2.4.1c2/Lib into bzrlib/ fixes the
problem (which, btw, is reported in:

More information about the bazaar mailing list