X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=TLD_Builder%2Fchroot.py;h=8acd58d10abd628384e8b39960ec30cca3dcf031;hb=9ea122b00e3a99b16246e1e38576916a2e25c0aa;hp=a489ac3cd01206a68c01e7eb09ab7420652c3893;hpb=92949e17161a53bfb4a60099e22b58ad63abce4c;p=tld-builder.git diff --git a/TLD_Builder/chroot.py b/TLD_Builder/chroot.py index a489ac3..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))) + 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: