def cp(file, outfile, user="builder", rm=False):
m = md5()
- m.update(str(random.sample(range(100000), 500)))
+ m.update(str(random.sample(range(100000), 500)).encode('utf-8'))
digest = m.hexdigest()
marker_start = "--- FILE BEGIN DIGEST %s ---" % digest
def recode(s):
if s.__class__ == ''.__class__:
- return s.decode('iso-8859-1', 'replace').encode('us-ascii', 'replace')
+ return s.encode('iso-8859-1', 'replace').decode('us-ascii', 'replace')
else:
- return s.encode('us-ascii', 'replace')
+ return s.decode('us-ascii', 'replace')
class Message:
def __init__(self):
import cgi
import pytz
import tempfile
+import subprocess
import util
import log
desc = "SH: <pre>%s</pre> flags: [%s]" % (self.command, ' '.join(self.command_flags))
else:
cmd = "/usr/bin/git ls-remote --heads git://git.tld-linux.org/packages/%s 1>/dev/null 2>&1" % (self.spec[:-5])
- r = call(cmd, shell=True)
+ r = subprocess.call(cmd, shell=True)
if r == 0:
package_url = "http://git.tld-linux.org/?p=packages/%(package)s.git;a=blob;f=%(spec)s;hb=%(branch)s" % {
'spec': urllib.quote(self.spec),