Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

volare/manage: skip directory when extracting #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

proppy
Copy link
Contributor

@proppy proppy commented Sep 15, 2022

enable currently fails with the following errors if a tar.xz file contains directories:

Traceback (most recent call last):
  File "/tmp/5/env/bin/volare", line 33, in <module>
    sys.exit(load_entry_point('volare', 'console_scripts', 'volare')())
  File "/tmp/5/env/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/tmp/5/env/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/tmp/5/env/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/tmp/5/env/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/tmp/5/env/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/proppy/src/github.com/efabless/volare/volare/manage.py", line 323, in enable_cmd
    enable(pdk_root=pdk_root, pdk=pdk, version=version)
  File "/home/proppy/src/github.com/efabless/volare/volare/manage.py", line 263, in enable
    with tf.extractfile(file) as io:
AttributeError: __enter__

calling extractfile on a TarInfo that's not a regular file will return None preventing the returned object to implement the contextmanager protocol.

This change checks that return TarInfo are regular files before attempting to extract them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant