使用boto和Jython的套接字错误

时间:2013-08-21 20:42:14

标签: python jython boto

我正在将最初在CPython中完成的项目移植到Jython以利用一些java库。事情似乎工作得很好,除了因为某些原因我在尝试用boto连接到s3时遇到错误:

>>> 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

在CPython中运行完全相同的连接代码非常有效。 我已经尝试强制boto记录调试消息,但它们在Jython和CPython之间完全相同,直到Jython失败。有没有人遇到这个问题或者有进一步调试的建议?

在ubuntu上运行Jython 2.7b1,CPython 2.7.4。

0 个答案:

没有答案