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

Copying the comment from
659d1917:

    @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?

This reverts commit 659d1917.
parent 0761d330
Pipeline #41969 passed with stage
in 15 minutes and 15 seconds
......@@ -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):
......
......@@ -152,14 +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] == '/':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment