lericson / simples3

Simple, quick Amazon AWS S3 interface in Python
BSD 2-Clause "Simplified" License
96 stars 36 forks source link

Don't bail when python lacks ssl support #6

Open jbergstroem opened 12 years ago

jbergstroem commented 12 years ago

If your python is compiled without ssl support, simples3 will start to cry:

python2.5 setup.py build -b build-2.5
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    import simples3
  File "simples3/__init__.py", line 124, in <module>
    from .bucket import S3File, S3Bucket, S3Error, KeyNotFound
  File "simples3/bucket.py", line 66, in <module>
    class StreamHTTPSHandler(urllib2.HTTPSHandler):
AttributeError: 'module' object has no attribute 'HTTPSHandler'

IMO ssl should be optional and not required

lericson commented 12 years ago

It is optional, though it seems like a disservice to the end-user not to force the library user to think about it. I forget how exactly one sets plain HTTP up, but basically you change the service_url.

HTH -L

lericson commented 12 years ago

As discussed on IRC it actually is required, mostly because the module-level names in simples3/bucket.py would need to be wrapped in ifs and things get ugly pretty quick. In fact I don't even know what StreamHTTPS?Handler is for.