Skip to content
Commit 659d1917 authored by root's avatar root
Browse files

diffoscope/comparators/symlink.py: added a try except block to track

ENOSPC errors.
diffoscope/comparators/zip.py: added an except condition to track ENOSPC
errors.

Both the above changes were made to ensure diffoscope fails more
gracefully in case ENOSPC is hit. These changes were tested with a
small tmpfs. The files used for testing were initrd.img and
initrd.img.old for first case and two .aia files for second case.

Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874582
parent b2b61327
Loading
Loading
Loading
Loading
  • @Vibhu-guest also I'm reverting this one, mostly because the authoring information is screwed (root <root@localhost.localdomain> - does this mean you are doing your work as root??), and should have probably be gone through an MR instead of being pushed to master.

    I'm also at odds about the changes themselves. You are catching that OSError in those two fairly specific positions, but it feels rather arbitrary. Surely ENOSPC could happen anywhere?

    Finally, I think the user at the end should at least getting something that tells them what the problem is. I think this way the program terminates without printing anything?

  • Mattia Rizzolo @mattia

    mentioned in commit 269864b7

    ·

    mentioned in commit 269864b7

    Toggle commit list
  • Developer

    As far as I could understand, ENOSPC was occurring due to no space left to create tempfiles. As I was testing with different types of files, I used two .deb files for which the source of error was the symlink.py. Similarly using .aia files was raising error from zip.py.

    So to handle these particular cases, I modified the above mentioned two files.

    However, if you recommend finding a more generic solution, then I will look through it again.

    For the last part, using try-except does raise a final error showing end of space, but the traceback is not shown.

    Also, I will be more careful about the authoring information now onwards.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment