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

Incompatibility with patool: unrecognized arguments: -y #5

Open
jayvdb opened this issue Apr 6, 2019 · 1 comment
Open

Incompatibility with patool: unrecognized arguments: -y #5

jayvdb opened this issue Apr 6, 2019 · 1 comment

Comments

@jayvdb
Copy link

jayvdb commented Apr 6, 2019

Argument -y is used by patool, but not supported by this wrapper. It is "Assume yes for all queries", which should be quite easy to implement. (but if the wrapper is stopping at the first unknown arg. and not mentioning other unknown args, there might be more problems after -y is added)

c.f. wummel/patool#69

[  130s] _____________________________ TestUnrar.test_unrar _____________________________
[  130s]
[  130s] args = (<tests.archives.test_unrar.TestUnrar testMethod=test_unrar>,)
[  130s] kwargs = {}
[  130s]
[  130s]     def newfunc(*args, **kwargs):
[  130s]         if not testfunc(name):
[  130s]             raise pytest.skip("%s %r is not available" % (description, name))
[  130s] >       return func(*args, **kwargs)
[  130s]
[  130s] tests/__init__.py:38:
[  130s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[  130s] tests/archives/test_unrar.py:25: in test_unrar
[  130s]     self.archive_list('t.rar')
[  130s] tests/archives/__init__.py:120: in archive_list
[  130s]     patoolib.list_archive(archive, program=self.program, verbosity=verbosity, interactive=False)
[  130s] patoolib/__init__.py:694: in list_archive
[  130s]     interactive=interactive, program=program)
[  130s] patoolib/__init__.py:543: in _handle_archive
[  130s]     run_archive_cmdlist(cmdlist, verbosity=verbosity)
[  130s] patoolib/__init__.py:421: in run_archive_cmdlist
[  130s]     return util.run_checked(cmdlist, verbosity=verbosity, **runkwargs)
[  130s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[  130s]
[  130s] cmd = ['/usr/bin/unrar', 'l', '-p-', '-y', '--', '/home/abuild/rpmbuild/BUILD/patool-upstream-1.12/tests/data/t.rar']
[  130s] ret_ok = (0,), kwargs = {'verbosity': -1}, retcode = 2
[  130s] msg = "Command `['/usr/bin/unrar', 'l', '-p-', '-y', '--', '/home/abuild/rpmbuild/BUILD/patool-upstream-1.12/tests/data/t.rar']' returned non-zero exit status 2"
[  130s]
[  130s]     def run_checked (cmd, ret_ok=(0,), **kwargs):
[  130s]         """Run command and raise PatoolError on error."""
[  130s]         retcode = run(cmd, **kwargs)
[  130s]         if retcode not in ret_ok:
[  130s]             msg = "Command `%s' returned non-zero exit status %d" % (cmd, retcode)
[  130s] >           raise PatoolError(msg)
[  130s] E           patoolib.util.PatoolError: Command `['/usr/bin/unrar', 'l', '-p-', '-y', '--', '/home/abuild/rpmbuild/BUILD/patool-upstream-1.12/tests/data/t.rar']' returned non-zero exit status 2
[  130s]
[  130s] patoolib/util.py:227: PatoolError
[  130s] ----------------------------- Captured stderr call -----------------------------
[  130s] usage: unrar [-h] [-o {+,-,r}] [-p PASSWORD]
[  130s]              {l,lt,lta,lb,t,v,vt,vta,vb,x} archive [rest [rest ...]]
[  130s] unrar: error: unrecognized arguments: -y
[  130s] __________________________ TestUnrar.test_unrar_file ___________________________
[  130s]
[  130s] args = (<tests.archives.test_unrar.TestUnrar testMethod=test_unrar_file>,)
[  130s] kwargs = {}
[  130s]
[  130s]     def newfunc(*args, **kwargs):
[  130s]         if not testfunc(name):
[  130s]             raise pytest.skip("%s %r is not available" % (description, name))
[  130s] >       return func(*args, **kwargs)
[  130s]
[  130s] tests/__init__.py:38:
[  130s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[  130s] tests/__init__.py:38: in newfunc
[  130s]     return func(*args, **kwargs)
[  130s] tests/archives/test_unrar.py:31: in test_unrar_file
[  130s]     self.archive_list('t.rar.foo')
[  130s] tests/archives/__init__.py:120: in archive_list
[  130s]     patoolib.list_archive(archive, program=self.program, verbosity=verbosity, interactive=False)
[  130s] patoolib/__init__.py:694: in list_archive
[  130s]     interactive=interactive, program=program)
[  130s] patoolib/__init__.py:543: in _handle_archive
[  130s]     run_archive_cmdlist(cmdlist, verbosity=verbosity)
[  130s] patoolib/__init__.py:421: in run_archive_cmdlist
[  130s]     return util.run_checked(cmdlist, verbosity=verbosity, **runkwargs)
[  130s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[  130s]
[  130s] cmd = ['/usr/bin/unrar', 'l', '-p-', '-y', '--', '/home/abuild/rpmbuild/BUILD/patool-upstream-1.12/tests/data/t.rar.foo']
[  130s] ret_ok = (0,), kwargs = {'verbosity': -1}, retcode = 2
[  130s] msg = "Command `['/usr/bin/unrar', 'l', '-p-', '-y', '--', '/home/abuild/rpmbuild/BUILD/patool-upstream-1.12/tests/data/t.rar.foo']' returned non-zero exit status 2"
[  130s]
[  130s]     def run_checked (cmd, ret_ok=(0,), **kwargs):
[  130s]         """Run command and raise PatoolError on error."""
[  130s]         retcode = run(cmd, **kwargs)
[  130s]         if retcode not in ret_ok:
[  130s]             msg = "Command `%s' returned non-zero exit status %d" % (cmd, retcode)
[  130s] >           raise PatoolError(msg)
[  130s] E           patoolib.util.PatoolError: Command `['/usr/bin/unrar', 'l', '-p-', '-y', '--', '/home/abuild/rpmbuild/BUILD/patool-upstream-1.12/tests/data/t.rar.foo']' returned non-zero exit status 2
[  130s]
[  130s] patoolib/util.py:227: PatoolError
[  130s] ----------------------------- Captured stderr call -----------------------------
[  130s] usage: unrar [-h] [-o {+,-,r}] [-p PASSWORD]
[  130s]              {l,lt,lta,lb,t,v,vt,vta,vb,x} archive [rest [rest ...]]
[  130s] unrar: error: unrecognized arguments: -y
@kstreitova
Copy link
Contributor

The problem is that there is no '-y' or similar option in unar. And as unrar_wrapper is a very simple tool that just translates unrar options to the unar options, I don't see an easy way how to do it.

I noticed that patool has an opened ticket for unar support. Maybe it would be a better way.

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

No branches or pull requests

2 participants