فهرست منبع

decode bytes from subprocess into a string before iterating over it in noapi.py

Helmut Pozimski 9 سال پیش
والد
کامیت
40ec070d13
2فایلهای تغییر یافته به همراه10 افزوده شده و 3 حذف شده
  1. 6 0
      debian/changelog
  2. 4 3
      lib_stov/noapi.py

+ 6 - 0
debian/changelog

@@ -1,3 +1,9 @@
+stov (0.9.3~beta1-1) unstable; urgency=low
+
+  * New upstream beta release
+
+ -- Helmut Pozimski <helmut@pozimski.eu>  Wed, 13 May 2015 21:47:00 +0200
+
 stov (0.9.3~beta-1) unstable; urgency=low
 
   * New upstream beta release

+ 4 - 3
lib_stov/noapi.py

@@ -101,9 +101,9 @@ class Connector(object):
                     "--match-title",
                     self._search,
                     "--get-id",
-                    self._url], stderr=stderr).strip()
+                    self._url], stderr=stderr)
             except subprocess.CalledProcessError as error_message:
-                video_ids = error_message.output.strip()
+                video_ids = error_message.output
         else:
             try:
                 video_ids = subprocess.check_output([
@@ -111,7 +111,8 @@ class Connector(object):
                     self._conf.values["maxvideos"], "--get-id",
                     self._url], stderr=stderr).strip()
             except subprocess.CalledProcessError as error_message:
-                video_ids = error_message.output.strip()
+                video_ids = error_message.output
+        video_ids = video_ids.decode(sys.stdout.encoding).strip()
         if len(video_ids) >= 1:
             for video_id in video_ids.split("\n"):
                 video_exists = False