untar builder fails with error

daggs <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <trinity-3f6b5124-65cf-42dd-bd88-e54bbdf15d7c-1667572385299@3c-app-mailcom-bs03>
Greetings,

I"m trying to implement the untar builder from https://github.com/SCons/scons/wiki/UnTarBuilder on scons v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691 (ubuntu 20.04)
and I'm getting this error:
AttributeError: 'TarInfo' object has no attribute 'target_peers':
  File "/home/dagg/project/site_scons/build_utils.py", line 471:
    env.Unpack(get_target(), deps_targets_list,
  File "/usr/lib/scons/SCons/Environment.py", line 255:
    return MethodWrapper.__call__(self, target, source, *args, **kw)
  File "/usr/lib/scons/SCons/Environment.py", line 219:
    return self.method(*nargs, **kwargs)
  File "/usr/lib/scons/SCons/Builder.py", line 651:
    return self._execute(env, target, source, OverrideWarner(kw), ekw)
  File "/usr/lib/scons/SCons/Builder.py", line 570:
    t.target_peers = tlist
Compilation failed

has anyone encountered this issue? I cannot seem to be able to find target_peers in reference to python anywhere

the builder looks like this:
import tarfile, os

def message(target, source, env):
    return "Unpacking..."

def builder(target, source, env):
    tar_file = tarfile.open(env['path'])
    tar_file.extractall(env['target'])
    tar_file.close()

    return None

def content_emitter(target, source, env):
    fn = os.path.basename(str(source[0]))
    print("Reading content...")
    tar_file = tarfile.open(str(source[0]), "r")
    new_targets = [ ent for ent in tar_file.getmembers() if ent.isfile() ]
    tar_file.close()
    print("Done")

    return (new_targets, source)

def generate(env, **kwargs):
    unpacker = env.Builder(
        action = env.Action(builder, message),
        src_suffix = ".tar.bz2",
        emitter = content_emitter,
    )

    env.Append(BUILDERS = { 'Unpack' : unpacker })

def exists(env):
    return True

Thanks,

dagg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.