def _one_boto_op(self, op, url):
    error = ''
    for i in range(NUM_S3OP_RETRIES):
        tmp = NamedTemporaryFile(dir=self._tmpdir, prefix='metaflow.s3.one_file.', delete=False)
        try:
            (s3, _) = get_s3_client()
            op(s3, tmp.name)
            return tmp.name
        except ClientError as err:
            error_code = s3op.normalize_client_error(err)
            if (error_code == 404):
                raise MetaflowS3NotFound(url)
            elif (error_code == 403):
                raise MetaflowS3AccessDenied(url)
            elif (error_code == 'NoSuchBucket'):
                raise MetaflowS3URLException("Specified S3 bucket doesn't exist.")
            error = str(err)
        except Exception as ex:
            error = str(ex)
        os.unlink(tmp.name)
        time.sleep(((2 ** i) + random.randint(0, 10)))
    raise MetaflowS3Exception(('S3 operation failed.\nKey requested: %s\nError: %s' % (url, error)))
def _one_boto_op(self, op, url):
    error = 
    for i in range(NUM_S3OP_RETRIES):
        tmp = NamedTemporaryFile(dir=self._tmpdir, prefix='metaflow.s3.one_file.', delete=False)
        try:
            (s3, _) = get_s3_client()
            op(s3, tmp.name)
            return tmp.name
        except ClientError as err:
            error_code = s3op.normalize_client_error(err)
            if (error_code == 404):
                raise MetaflowS3NotFound(url)
            elif (error_code == 403):
                raise MetaflowS3AccessDenied(url)
            elif (error_code == 'NoSuchBucket'):
                raise MetaflowS3URLException("Specified S3 bucket doesn't exist.")
            error = str(err)
        except Exception as ex:
            error = str(ex)
        os.unlink(tmp.name)
        time.sleep(((2 ** i) + random.randint(0, 10)))
    raise MetaflowS3Exception(('S3 operation failed.\nKey requested: %s\nError: %s' % (url, error)))