File 0002-Copy-logic-fixes.patch of Package flac2all
From 793783381e7a3db4a3d84781dad5a4e7a02a7925 Mon Sep 17 00:00:00 2001
From: zv <info@ziva-vatra.com>
Date: Thu, 27 Feb 2020 15:14:02 +0000
Subject: [PATCH 2/5] Copy logic fixes
---
flac2all_pkg/core.py | 2 +-
flac2all_pkg/mp3.py | 12 ++++++------
flac2all_pkg/multiprocess_encode.py | 4 +---
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/flac2all_pkg/core.py b/flac2all_pkg/core.py
index 572edf0..ca172e5 100755
--- a/flac2all_pkg/core.py
+++ b/flac2all_pkg/core.py
@@ -188,7 +188,7 @@ def write_logfile(outdir, results):
"infile,outfile,format,conversion_status,return_code,execution_time\n"
)
for item in results:
- item = [str(x) for x in item]
+ item = [str(x, "utf-8") for x in item]
line = ','.join(item)
fd.write("%s\n" % line.encode("utf-8", "backslashreplace"))
fd.close()
diff --git a/flac2all_pkg/mp3.py b/flac2all_pkg/mp3.py
index 014011e..4f01221 100644
--- a/flac2all_pkg/mp3.py
+++ b/flac2all_pkg/mp3.py
@@ -11,13 +11,13 @@ if __name__ == '__main__' and __package__ is None:
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
try:
- from logging import console
- from flac import flac, flacdecode
- from config import ipath
+ from logging import console
+ from flac import flac, flacdecode
+ from config import ipath
except ImportError:
- from .logging import console
- from .flac import flac, flacdecode
- from .config import ipath
+ from .logging import console
+ from .flac import flac, flacdecode
+ from .config import ipath
log = console(stderr=True)
diff --git a/flac2all_pkg/multiprocess_encode.py b/flac2all_pkg/multiprocess_encode.py
index 8644f4a..fa02051 100755
--- a/flac2all_pkg/multiprocess_encode.py
+++ b/flac2all_pkg/multiprocess_encode.py
@@ -110,7 +110,7 @@ def encode():
cc = opts['threads']
while int(cc) > (len(ap)):
- log.info("Spawning execution process")
+ # Spawning execution process here
proc = encode_thread(int(cc), "Thread %d" % int(cc), pQ, opts, lQ)
proc.start()
ap.append(proc)
@@ -124,10 +124,8 @@ def encode():
try:
pQ.put(pQ.get(timeout=10))
except mp.TimeoutError as e:
- log.ok("Process queue finished.")
sflags[0] = 1
except queue.Empty as e:
- log.ok("Process queue finished.")
sflags[0] = 1
else:
sflags[0] = 0
--
2.25.1