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

unrar doesn't have a "--version" flag #1175

Closed
Freso opened this issue Dec 28, 2014 · 9 comments
Closed

unrar doesn't have a "--version" flag #1175

Freso opened this issue Dec 28, 2014 · 9 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@Freso
Copy link
Member

Freso commented Dec 28, 2014

Running python setup.py test in an virtualenv after a python setup.py install from a fresh Git checkout (a892128) fails due to my version of unrar being different from the one used to write the tests:

running test
running egg_info
writing requirements to beets.egg-info/requires.txt
writing beets.egg-info/PKG-INFO
writing top-level names to beets.egg-info/top_level.txt
writing dependency_links to beets.egg-info/dependency_links.txt
writing entry points to beets.egg-info/entry_points.txt
reading manifest file 'beets.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'man/beet.1'
warning: no files found matching 'man/beetsconfig.5'
no previously-included directories found matching 'docs/_build'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
writing manifest file 'beets.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 122, in <module>
    'Programming Language :: Python :: 2.7',
  File "/usr/lib64/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/home/freso/Development/Beets/venv-beets/lib/python2.7/site-packages/setuptools/command/test.py", line 146, in run
    self.with_project_on_sys_path(self.run_tests)
  File "/home/freso/Development/Beets/venv-beets/lib/python2.7/site-packages/setuptools/command/test.py", line 127, in with_project_on_sys_path
    func()
  File "/home/freso/Development/Beets/venv-beets/lib/python2.7/site-packages/setuptools/command/test.py", line 167, in run_tests
    testRunner=self._resolve_as_ep(self.test_runner),
  File "/usr/lib64/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python2.7/unittest/main.py", line 149, in parseArgs
    self.createTests()
  File "/usr/lib64/python2.7/unittest/main.py", line 158, in createTests
    self.module)
  File "/usr/lib64/python2.7/unittest/loader.py", line 130, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib64/python2.7/unittest/loader.py", line 115, in loadTestsFromName
    test = obj()
  File "/home/freso/Development/Beets/beets/test/testall.py", line 43, in suite
    s.addTest(__import__(modname).suite())
  File "/home/freso/Development/Beets/beets/test/test_importadded.py", line 20, in <module>
    from test.test_importer import ImportHelper, AutotagStub
  File "/home/freso/Development/Beets/beets/test/test_importer.py", line 405, in <module>
    @unittest.skipIf(not has_program('unrar'), 'unrar program not found')
  File "/home/freso/Development/Beets/beets/test/helper.py", line 120, in has_program
    stdout=devnull, stdin=devnull)
  File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['unrar', '--version']' returned non-zero exit status 7

Running unrar --version manually gives me:

ERROR: Unknown option: -version

It doesn't seem to have any kind of version flag at all, but instead prints the version information as part of its standard output.

@Freso
Copy link
Member Author

Freso commented Dec 28, 2014

I guess this isn't actually a failed test, but rather showing that the importer doesn't work with that version of unrar - so the test is working as it should!

@Freso Freso changed the title setup.py test currently broken Import doesn't with unrar from rarlab.com Dec 28, 2014
@Freso Freso changed the title Import doesn't with unrar from rarlab.com Import doesn't work with unrar from rarlab.com Dec 28, 2014
@sampsyo sampsyo added the bug bugs that are confirmed and actionable label Dec 28, 2014
@sampsyo
Copy link
Member

sampsyo commented Dec 28, 2014

Thanks; I didn't know there was an incompatibility. Can you check what the equivalent is for your unrar? unrar -v or somesuch? Should be an easy fix then.

FWIW, nose is usually the most convenient way to run the tests. The Testing wiki page has more.

@sampsyo
Copy link
Member

sampsyo commented Dec 28, 2014

Also, I should add that we don't yet know whether the importer is broken; what failed here is the part of the tests that checks whether you have unrar.

@sampsyo sampsyo added needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." and removed bug bugs that are confirmed and actionable labels Dec 28, 2014
Freso added a commit to Freso/beets that referenced this issue Dec 28, 2014
sampsyo added a commit that referenced this issue Dec 28, 2014
changelog: #1175 is unrelated to the fix in #1176
@Freso
Copy link
Member Author

Freso commented Dec 29, 2014

Can you check what the equivalent is for your unrar? unrar -v or somesuch?

I answered this in the original comment :

It doesn't seem to have any kind of version flag at all, but instead prints the version information as part of its standard output.

And yeah, I would use nosetests normally, but didn't want to add even more to the virtualenv for what I figured was just a quick test. :)

@sampsyo
Copy link
Member

sampsyo commented Dec 29, 2014

Oops, sorry for reading too quickly. I have never used either version of unrar, so I could use some help here from anyone interested in figuring out if we can adapt to this version gracefully (or whether we should just detect and ignore it).

Freso added a commit to Freso/beets that referenced this issue Dec 29, 2014
`has_program()` by default appends `--version` to the command to test
for, but `unrar` doesn’t recognise this flag.

Fixes beetbox#1175.
@Freso Freso changed the title Import doesn't work with unrar from rarlab.com unrar doesn't have a "--version" flag Dec 29, 2014
@geigerzaehler
Copy link

I fixed the test setup. Unknown unrar versions will be skipped now. @Freso, could you provide the invocation for your unrar that is simliar to unrar --version? We then can also run the tests for your version.

@Freso
Copy link
Member Author

Freso commented Dec 29, 2014

Your fix isn't a fix though, it's just a work-around hiding the error. The error is that has_program() appends --version to program calls by default, and the check for unrar doesn't unset this. I fixed this in #1185.

could you provide the invocation for your unrar that is simliar to unrar --version?

I did this in the original comment:

It doesn't seem to have any kind of version flag at all, but instead prints the version information as part of its standard output.

By "standard output", I mean "unrar".

@sampsyo
Copy link
Member

sampsyo commented Dec 29, 2014

Seems OK for now (we're just requiring an unrar with a --version flag). An empty argument list would be fine too if we can show that doesn't break the other unrar.

@Freso
Copy link
Member Author

Freso commented Dec 30, 2014

Apparently there's a FOSS unrar as well, which might be the one available when this test was written: http://home.gna.org/unrar/
The version ArchLinux recognises as "unrar" is the one from RARLab.com (home of the rar archive format): http://www.rarlab.com/rar_add.htm (building from "UnRAR source")

The output of unrar is: http://sprunge.us/PWCM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

3 participants