diff --git a/builder/kojid b/builder/kojid index 3d740db5..921bac4e 100755 --- a/builder/kojid +++ b/builder/kojid @@ -430,7 +430,7 @@ class BuildRoot(object): if workdir: outfile = os.path.join(workdir, mocklog) flags = os.O_CREAT | os.O_WRONLY | os.O_APPEND - fd = os.open(outfile, flags, 0666) + fd = os.open(outfile, flags, 0o666) os.dup2(fd, 1) os.dup2(fd, 2) if os.getuid() == 0 and hasattr(self.options,"mockuser"): @@ -1347,7 +1347,7 @@ class BuildMavenTask(BaseBuildTask): st = os.lstat(filepath) mtime = time.localtime(st.st_mtime) info = zipfile.ZipInfo(filepath[roottrim:]) - info.external_attr |= 0120000 << 16L # symlink file type + info.external_attr |= 0o120000 << 16 # symlink file type info.compress_type = zipfile.ZIP_STORED info.date_time = mtime[:6] zfo.writestr(info, content) diff --git a/cli/koji b/cli/koji index 4a192fcb..30e5ab2c 100755 --- a/cli/koji +++ b/cli/koji @@ -1579,7 +1579,7 @@ def handle_restart_hosts(options, session, args): def linked_upload(localfile, path, name=None): """Link a file into the (locally writable) workdir, bypassing upload""" - old_umask = os.umask(002) + old_umask = os.umask(0o02) try: if name is None: name = os.path.basename(localfile) diff --git a/hub/kojihub.py b/hub/kojihub.py index 2fec4ea3..839b6488 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -8814,7 +8814,7 @@ class RootExports(object): # but we allow .log files to be uploaded multiple times to support # realtime log-file viewing raise koji.GenericError("file already exists: %s" % fn) - fd = os.open(fn, os.O_RDWR | os.O_CREAT, 0666) + fd = os.open(fn, os.O_RDWR | os.O_CREAT, 0o666) # log_error("fd=%r" %fd) try: if offset == 0 or (offset == -1 and size == len(contents)): @@ -12523,7 +12523,7 @@ def handle_upload(environ): size = 0 chksum = sum_cls() inf = environ['wsgi.input'] - fd = os.open(fn, os.O_RDWR | os.O_CREAT, 0666) + fd = os.open(fn, os.O_RDWR | os.O_CREAT, 0o666) try: try: fcntl.lockf(fd, fcntl.LOCK_EX|fcntl.LOCK_NB) diff --git a/koji/daemon.py b/koji/daemon.py index f298abc4..9b98eeaa 100644 --- a/koji/daemon.py +++ b/koji/daemon.py @@ -113,7 +113,7 @@ def log_output(session, path, args, outfile, uploadpath, cwd=None, logerror=0, a flags = os.O_CREAT | os.O_WRONLY if append: flags |= os.O_APPEND - fd = os.open(outfile, flags, 0666) + fd = os.open(outfile, flags, 0o666) os.dup2(fd, 1) if logerror: os.dup2(fd, 2) diff --git a/koji/util.py b/koji/util.py index 96d24abf..dfbc020c 100644 --- a/koji/util.py +++ b/koji/util.py @@ -466,12 +466,12 @@ class adler32_constructor(object): #mimicing the hashlib constructors def __init__(self, arg=''): - self._value = adler32(arg) & 0xffffffffL + self._value = adler32(arg) & 0xffffffff #the bitwise and works around a bug in some versions of python #see: https://bugs.python.org/issue1202 def update(self, arg): - self._value = adler32(arg, self._value) & 0xffffffffL + self._value = adler32(arg, self._value) & 0xffffffff def digest(self): return self._value diff --git a/util/koji-shadow b/util/koji-shadow index 0b93b846..d741c219 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -883,7 +883,7 @@ class BuildTracker(object): if options.link_imports: #bit of a hack, but faster than uploading dst = "%s/%s/%s" % (koji.pathinfo.work(), serverdir, fn) - old_umask = os.umask(002) + old_umask = os.umask(0o02) try: koji.ensuredir(os.path.dirname(dst)) os.chown(os.path.dirname(dst), 48, 48) #XXX - hack @@ -1303,7 +1303,7 @@ def main(args): if options.logfile: filename = options.logfile try: - logfile = os.open(filename,os.O_CREAT|os.O_RDWR|os.O_APPEND, 0777) + logfile = os.open(filename,os.O_CREAT|os.O_RDWR|os.O_APPEND, 0o777) except: logfile = None if logfile is not None: