Sample code to use boto (not boto3) with Spaces

October 25, 2017 176 views
Object Storage Python

I'm hoping for sample code using boto (not boto3) for writing an object to the Spaces system and then reading it back.

This StackOverflow question 1 suggested one approach to get started, but the following code produces the result None:

    import boto
    s3 = boto.s3.S3RegionInfo(name='nyc3', 
                              endpoint='https://nyc3.digitaloceanspaces.com',
                              aws_access_key_id=XXXX,
                              aws_secret_access_key=XXXX).connect()
    print s3

I haven't been able to find anything else potentially relevant.

(Why do I want to use boto instead of boto3? Answer: I have boto3 code working perfectly in my test system, but it fails in what seems to be unpredictable ways when operating at scale, and the fail seems to be inside boto3. If I can get the code working in boto, it is not only a workaround, but would suggest there is a boto3 problem.)

2 comments
Be the first one to answer this question.