X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;ds=inline;f=TLD_Builder%2Fchroot.py;h=8acd58d10abd628384e8b39960ec30cca3dcf031;hb=9ea122b00e3a99b16246e1e38576916a2e25c0aa;hp=f91e1c60369c6d0511f9391753430ba5e597d877;hpb=b06ac0a74084c2ed513ecead310ea47208344d14;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: