Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
s3sync
from awscli.clidriver import create_clidriver
def s3sync(source, destination, *options):
old_env = dict(os.environ)
try:
env = os.environ.copy()
env["LC_CTYPE"] = u"en_US.UTF"
os.environ.update(env)
exit_code = create_clidriver().main(["s3", "sync", source, destination] + list(options))
if exit_code > 0:
raise RuntimeError("AWS S3 cli exited with code {0}".format(exit_code))
finally:
os.environ.clear()
os.environ.update()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.