Wednesday, 21 August 2013

socket error using boto with Jython

socket error using boto with Jython

I'm in the process of porting a project originally done in CPython over to
Jython in order to leverage some java libraries. Things seem to be working
fine except that for some reason I'm getting errors when trying to connect
to s3 with boto:
>>> from boto.s3.connection import S3Connection
>>> s3 = S3Connection(aws_access_id, aws_secret_key)
>>> s3.get_all_buckets()
File "<stdin>", line 1, in <module>
File "/usr/share/jython/Lib/site-packages/boto/s3/connection.py", line
384, in
body = response.read()
File "/usr/share/jython/Lib/site-packages/boto/connection.py", line 411,
in rea
self._cached_response = httplib.HTTPResponse.read(self)
File "/usr/share/jython/Lib/httplib.py", line 546, in read
s = self.fp.read()
File "/usr/share/jython/Lib/httplib.py", line 1296, in read
return s + self._file.read()
File "/usr/share/jython/Lib/socket.py", line 1672, in read
data = self._sock.recv(recv_size)
File "/usr/share/jython/Lib/socket.py", line 180, in set_last_error
return method(obj, *args, **kwargs)
File "/usr/share/jython/Lib/socket.py", line 171, in map_exception
raise _map_exception(jlx)
socket.error: [Errno 104] Software caused connection abort
Running the exact same connection code in CPython works perfectly. I've
tried forcing boto to log debug messages, but they are the exact same
between Jython and CPython until the Jython one fails. Has anyone run into
this before or have any suggestions for debugging this further?

No comments:

Post a Comment