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

whipper drive analyze is broken on Python 3 #431

Closed
emilazy opened this issue Dec 14, 2019 · 3 comments · Fixed by #434
Closed

whipper drive analyze is broken on Python 3 #431

emilazy opened this issue Dec 14, 2019 · 3 comments · Fixed by #434
Labels
Accepted Accepted issue on our roadmap Bug Generic bug: can be used together with more specific labels Regression Bug that breaks functionality known to work in previous releases
Milestone

Comments

@emilazy
Copy link

emilazy commented Dec 14, 2019

[emily@renko:~/src/nixpkgs]$ whipper drive analyze
CRITICAL:whipper.command.main:exception TypeError at /nix/store/jm02h0yd9c1r77wc6b1lqqq0s0dsgi7y-whipper-0.9.0/lib/python3.7/site-packages/whipper/program/cdparanoia.py:606: failed(): sequence item 0: expected str instance, bytes found
Traceback (most recent call last):
  File "/nix/store/jm02h0yd9c1r77wc6b1lqqq0s0dsgi7y-whipper-0.9.0/lib/python3.7/site-packages/whipper/common/task.py", line 89, in _read
    self._done()
  File "/nix/store/jm02h0yd9c1r77wc6b1lqqq0s0dsgi7y-whipper-0.9.0/lib/python3.7/site-packages/whipper/common/task.py", line 107, in _done
    self.failed()
  File "/nix/store/jm02h0yd9c1r77wc6b1lqqq0s0dsgi7y-whipper-0.9.0/lib/python3.7/site-packages/whipper/program/cdparanoia.py", line 606, in failed
    output = "".join(self._output)
TypeError: sequence item 0: expected str instance, bytes found
@github-actions
Copy link

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing instructions.

@MerlijnWajer
Copy link
Collaborator

Try this?

From 305678ec85568e9fdbc888078c11a1f7d4bc0100 Mon Sep 17 00:00:00 2001
From: Merlijn Wajer <merlijn@wizzup.org>
Date: Sat, 14 Dec 2019 18:16:30 +0800
Subject: [PATCH] program/cdparanoia: fix failed() task of AnalyzeTask

---
 whipper/program/cdparanoia.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/whipper/program/cdparanoia.py b/whipper/program/cdparanoia.py
index 636e6f5..f071674 100644
--- a/whipper/program/cdparanoia.py
+++ b/whipper/program/cdparanoia.py
@@ -603,7 +603,7 @@ class AnalyzeTask(ctask.PopenTask):
     def failed(self):
         # cdparanoia exits with return code 1 if it can't determine
         # whether it can defeat the audio cache
-        output = "".join(self._output)
+        output = "".join(o.decode() for o in self._output)
         m = _WARNING_RE.search(output)
         if m or _ABORTING_RE.search(output):
             self.defeatsCache = False
-- 
2.17.1

@emilazy
Copy link
Author

emilazy commented Dec 14, 2019

Yep, that fixes it; apologies for not submitting the patch myself, I opened this as a note to self at 4 am :)

@JoeLametta JoeLametta added Accepted Accepted issue on our roadmap Bug Generic bug: can be used together with more specific labels Regression Bug that breaks functionality known to work in previous releases labels Dec 15, 2019
@JoeLametta JoeLametta added this to the 1.0 milestone Dec 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Bug Generic bug: can be used together with more specific labels Regression Bug that breaks functionality known to work in previous releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants