=== modified file 'apt_clone.py' --- apt_clone.py 2014-02-10 10:36:19 +0000 +++ apt_clone.py 2014-04-18 17:19:52 +0000 @@ -247,7 +247,7 @@ def _add_file_to_tar_with_password_check(self, tar, sources, scrub, arcname): if scrub: - with tempfile.NamedTemporaryFile(mode='wb') as source_copy, open(sources, 'r') as f: + with tempfile.NamedTemporaryFile(mode='wb') as source_copy, open(sources, 'rb') as f: for line in f.readlines(): if re.search('/[^/@:]*:[^/@:]*@', line): line = re.sub('/[^/@:]*:[^/@:]*@', @@ -256,8 +256,8 @@ # open in Unicode mode in Python 2. We can remove this # once ubuntu-release-upgrader is run under Python 3 # (i.e. after Ubuntu 14.04). - if line is not bytes: - line = line.encode("UTF-8") + #if line is not bytes: + # line = line.encode("UTF-8") source_copy.write(line) source_copy.flush() tar.add(source_copy.name, arcname=arcname)