dahlia / sqlalchemy-imageattach

SQLAlchemy extension for attaching images to entities.
https://sqlalchemy-imageattach.readthedocs.io/
MIT License
116 stars 25 forks source link

UnboundLocalError: local variable 'e' referenced in S3Store object #22

Closed ThePFMind closed 10 years ago

ThePFMind commented 10 years ago

There is some unbound error in sqlalchemy_imageattach.stores.s3.S3Store object

 def upload_file(self, url, data, content_type, rrs, acl='public-read'):
...
        while 1:
            try:
                urllib2.urlopen(request).read()
            except urllib2.HTTPError as e:
                if 400 <= e.code < 500:
                    self.logger.exception(e)
                    self.logger.debug(e.read())
                    raise
                self.logger.debug(e)
                continue
            except IOError:
>               self.logger.debug(e)
E               UnboundLocalError: local variable 'e' referenced before assignment
dahlia commented 10 years ago

Fixed by #20.