[Reproducible-builds] Bug#781280: --text crashes when encountering empty files

Helmut Grohne helmut at subdivi.de
Thu Mar 26 20:43:39 UTC 2015


Package: debbindiff
Version: 11
Tags: patch
User: helmutg at debian.org
Usertags: rebootstrap

debbindiff --text crashes when it encounters an empty file.

Example input package triggering the error: libreadline6

Example traceback being fixed:

Traceback (most recent call last):
  File "/usr/bin/debbindiff", line 120, in <module>
    sys.exit(main())
  File "/usr/bin/debbindiff", line 114, in main
    output_text(differences, print_func=print_func)
  File "/usr/lib/python2.7/dist-packages/debbindiff/presenters/text.py", line 71, in output_text
    print_details(difference, print_func)
  File "/usr/lib/python2.7/dist-packages/debbindiff/presenters/text.py", line 62, in print_details
    print_details(detail, new_print_func)
  File "/usr/lib/python2.7/dist-packages/debbindiff/presenters/text.py", line 62, in print_details
    print_details(detail, new_print_func)
  File "/usr/lib/python2.7/dist-packages/debbindiff/presenters/text.py", line 62, in print_details
    print_details(detail, new_print_func)
  File "/usr/lib/python2.7/dist-packages/debbindiff/presenters/text.py", line 59, in print_details
    print_difference(detail, print_func)
  File "/usr/lib/python2.7/dist-packages/debbindiff/presenters/text.py", line 36, in print_difference
    if not difference.lines2[-1].endswith('\n'):
IndexError: list index out of range

I think the fix is pretty straight forward.

Helmut
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-IndexError-from-text-with-empty-files.patch
Type: text/x-diff
Size: 2495 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20150326/b9afbc66/attachment.patch>


More information about the Reproducible-builds mailing list