But the command line script archive-tool.py fails with a NameError while trying to emit this warning:
$ archive-tool create archive-tmp.tar /tmp/.X11-unix
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/archive/manifest.py", line 133, in iterpaths
info = cls(path=p)
File "/usr/lib/python3.6/site-packages/archive/manifest.py", line 61, in __init__
raise ArchiveInvalidTypeError(self.path, ftype)
archive.exception.ArchiveInvalidTypeError: /tmp/.X11-unix/X0: socket
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/archive-tool", line 5, in <module>
archive.cli.archive_tool()
File "/usr/lib/python3.6/site-packages/archive/cli/__init__.py", line 44, in archive_tool
sys.exit(args.func(args))
File "/usr/lib/python3.6/site-packages/archive/cli/create.py", line 28, in create
tags=args.tag)
File "/usr/lib/python3.6/site-packages/archive/archive.py", line 76, in create
self._create(path, mode, paths, basedir, excludes, dedup, tags)
File "/usr/lib/python3.6/site-packages/archive/archive.py", line 82, in _create
self.manifest = Manifest(paths=paths, excludes=excludes, tags=tags)
File "/usr/lib/python3.6/site-packages/archive/manifest.py", line 165, in __init__
self.fileinfos = sorted(fileinfos, key=lambda fi: fi.path)
File "/usr/lib/python3.6/site-packages/archive/manifest.py", line 140, in iterpaths
yield from cls.iterpaths(p.iterdir(), excludes)
File "/usr/lib/python3.6/site-packages/archive/manifest.py", line 135, in iterpaths
warnings.warn(ArchiveWarning("%s ignored" % e))
File "/usr/lib64/python3.6/warnings.py", line 99, in _showwarnmsg
msg.file, msg.line)
File "/usr/lib/python3.6/site-packages/archive/cli/__init__.py", line 25, in showwarning
s = "%s: %s\n" % (argparser.prog, message)
NameError: name 'argparser' is not defined
A warning is raised when trying to add a file to an archive having an unsupported type, ref. #34:
But the command line script
archive-tool.py
fails with aNameError
while trying to emit this warning: