c83f6f17866a3d114c174ba282e4dff2fd9996f7,src/python/pants/cache/artifact.py,TarballArtifact,extract,#TarballArtifact#,111

Before Change


        // the same directory, so T1 throws "File exists" in B).
        // This actually happened, and was very hard to debug.
        // Creating the paths here up front allows us to squelch that "File exists" error.
        paths = []
        dirs = set()
        for tarinfo in tarin.getmembers():
          paths.append(tarinfo.name)
          if tarinfo.isdir():
            dirs.add(tarinfo.name)
          else:
            dirs.add(os.path.dirname(tarinfo.name))
        for d in dirs:
          try:
            os.makedirs(os.path.join(self._artifact_root, d))
          except OSError as e:

After Change


  def extract(self):
    // Note(yic): unlike the python implementation before, now we do not update self._relpath
    // after the extraction.
    try:
      self.NATIVE_BINARY.decompress_tarball(self._tarfile.encode("utf-8"),
                                            self._artifact_root.encode("utf-8"))
    except Exception as e:
      raise ArtifactError("Extracting artifact failed:\n{}".format(e))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: pantsbuild/pants
Commit Name: c83f6f17866a3d114c174ba282e4dff2fd9996f7
Time: 2018-11-18
Author: wisechengyi@gmail.com
File Name: src/python/pants/cache/artifact.py
Class Name: TarballArtifact
Method Name: extract


Project Name: brian-team/brian2
Commit Name: 2db605d4a44e33306af74892eecbfef75a1d44d8
Time: 2014-02-19
Author: dan.goodman@ens.fr
File Name: brian2/equations/equations.py
Class Name: Equations
Method Name: _sort_static_equations


Project Name: pyinstaller/pyinstaller
Commit Name: 98100abde55f1fb0ab455f95b9259c3adcdbab2c
Time: 2015-10-19
Author: h.goebel@crazy-compilers.com
File Name: PyInstaller/building/imphook.py
Class Name: ImportHook
Method Name: _process_excludedimports