From a78556b56a3dd77daec148a297b955e7693ced7f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 21 Feb 2020 16:37:58 +0100 Subject: [PATCH] [unpackfs] Revert text mode - Follow original patch from Gabriel Craciunescu: just drop the *bufsize* parameter and stick to binary reads. Text mode was associated in my testing with multiple hangs, which didn't show up during binary-reads. --- src/modules/unpackfs/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/unpackfs/main.py b/src/modules/unpackfs/main.py index 5e4287048..b08315968 100644 --- a/src/modules/unpackfs/main.py +++ b/src/modules/unpackfs/main.py @@ -133,7 +133,7 @@ def file_copy(source, entry, progress_cb): args.extend(["--exclude", f]) args.extend(['--progress', source, dest]) process = subprocess.Popen( - args, env=at_env, universal_newlines=True, bufsize=1, + args, env=at_env, stdout=subprocess.PIPE, close_fds=ON_POSIX ) # last_num_files_copied trails num_files_copied, and whenever at least 100 more @@ -154,7 +154,7 @@ def file_copy(source, entry, progress_cb): # If you're copying directory with some links in it, the xfer# # might not be a reliable counter (for one increase of xfer, many # files may be created). - m = re.findall(r'xfr#(\d+), ..-chk=(\d+)/(\d+)', line) + m = re.findall(r'xfr#(\d+), ..-chk=(\d+)/(\d+)', line.decode()) if m: # we've got a percentage update