[Git][reproducible-builds/diffoscope][master] 2 commits: Revert "Modified zip.py to handle ENOSPC"

Mattia Rizzolo gitlab at salsa.debian.org
Tue Apr 2 20:55:11 CEST 2019



Mattia Rizzolo pushed to branch master at Reproducible Builds / diffoscope


Commits:
0761d330 by Mattia Rizzolo at 2019-04-02T18:46:25Z
Revert "Modified zip.py to handle ENOSPC"

This commit isn't what the message says, and it breaks `black`

This reverts commit 465176e0c1539dab6723a890edb40d17cde46563.

- - - - -
269864b7 by Mattia Rizzolo at 2019-04-02T18:53:25Z
Revert "diffoscope/comparators/symlink.py: added a try except block to track"

Copying the comment from
https://salsa.debian.org/reproducible-builds/diffoscope/commit/659d19172e04460fbbd48681ca917d8c583cdc1d:

    @Vibhu-guest also I'm reverting this one, mostly because the
    authoring information is screwed (root <root at 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?

This reverts commit 659d19172e04460fbbd48681ca917d8c583cdc1d.

- - - - -


2 changed files:

- diffoscope/comparators/symlink.py
- diffoscope/comparators/zip.py


Changes:

=====================================
diffoscope/comparators/symlink.py
=====================================
@@ -19,9 +19,7 @@
 
 import os
 import logging
-import sys
 
-from diffoscope.exc import ContainerExtractionError
 from diffoscope.tempfiles import get_named_temporary_file
 from diffoscope.difference import Difference
 
@@ -42,20 +40,10 @@ class Symlink(File):
         return os.readlink(self.name)
 
     def create_placeholder(self):
-        
-        try:
-            with get_named_temporary_file('w+', delete=False) as f:
-                f.write('destination: %s\n' % self.symlink_destination)
-                f.flush()
-                return f.name
-
-        except OSError as ose:
-            if (ose.errno == 28):
-                sys.tracebacklimit = 0
-                raise ose
-
-            else:
-                raise   
+        with get_named_temporary_file('w+', delete=False) as f:
+            f.write('destination: %s\n' % self.symlink_destination)
+            f.flush()
+            return f.name
 
     @property
     def path(self):


=====================================
diffoscope/comparators/zip.py
=====================================
@@ -152,13 +152,6 @@ class ZipContainer(Archive):
                 raise ContainerExtractionError(member_name, exc)
             raise
 
-        except OSError as ose:
-            if (ose.errno == 28):
-                sys.tracebacklimit = 0
-                raise ose
-            else:
-                raise 
-
     def get_member(self, member_name):
         zipinfo = self.archive.getinfo(member_name)
         if zipinfo.filename[-1] == '/':



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/465176e0c1539dab6723a890edb40d17cde46563...269864b76c61780afc57d6a1a0078b1762bf40f9

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/compare/465176e0c1539dab6723a890edb40d17cde46563...269864b76c61780afc57d6a1a0078b1762bf40f9
You're receiving this email because of your account on salsa.debian.org.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20190402/994fa38f/attachment.html>


More information about the rb-commits mailing list