]> git.0d.be Git - django-panik-nonstop.git/commitdiff
treat sox output as strings
authorFrédéric Péters <fpeters@0d.be>
Wed, 8 Apr 2020 06:57:48 +0000 (08:57 +0200)
committerFrédéric Péters <fpeters@0d.be>
Wed, 8 Apr 2020 06:57:48 +0000 (08:57 +0200)
nonstop/management/commands/compute_durations.py

index f8fe2ab37a81ec850dd694bcb600b24a489d6485..c3da116c8b241775f18ec198a9574ab56bd58ce7 100644 (file)
@@ -4,6 +4,7 @@ import re
 import subprocess
 
 from django.core.management.base import BaseCommand, CommandError
+from django.utils.encoding import force_text
 
 from ...models import NonstopFile, Track
 
@@ -27,6 +28,7 @@ def get_duration(filename):
                          stderr=subprocess.PIPE)
     stdout, stderr = p.communicate()
     for line in stdout.splitlines():
+        line = force_text(line)
         if not line.startswith('Duration'):
              continue
         try: