Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _copyfile(in_fname, out_fname):
# Copies files without read / write permission
perms = chmod_perms(in_fname)
with open_rw(in_fname, 'rb') as fobj:
contents = fobj.read()
with open_rw(out_fname, 'wb') as fobj:
fobj.write(contents)
os.chmod(out_fname, perms)