X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=TLD_Builder%2Fchroot.py;h=8acd58d10abd628384e8b39960ec30cca3dcf031;hb=d5c47ccb4a425d1b982888101273651b2d4db38d;hp=f91e1c60369c6d0511f9391753430ba5e597d877;hpb=99c8ec16ca741caf94419fa7976525744ce9aed1;p=tld-builder.git diff --git a/TLD_Builder/chroot.py b/TLD_Builder/chroot.py index f91e1c6..8acd58d 100644 --- a/TLD_Builder/chroot.py +++ b/TLD_Builder/chroot.py @@ -3,6 +3,7 @@ import os import re import random +import util try: from hashlib import md5 as md5 @@ -49,7 +50,7 @@ def run(cmd, user = "builder", logfile = None, logstdout = None): def cp(file, outfile, user="builder", rm=False): m = md5() - m.update(str(random.sample(range(100000), 500)).encode('utf-8')) + m.update(util.to_bytes(str(random.sample(range(100000), 500)))) digest = m.hexdigest() marker_start = "--- FILE BEGIN DIGEST %s ---" % digest @@ -70,11 +71,11 @@ def cp(file, outfile, user="builder", rm=False): me = l.find(marker_end) if me != -1: l = l[:me] - f.write(l) + f.write(util.to_bytes(l)) marker = False break if marker: - f.write(l) + f.write(util.to_bytes(l)) rp = p.close() rf = f.close() if rp == None: