【发布时间】:2016-09-02 00:39:05
【问题描述】:
我有 boto 2.3.0 neo 分支和 python 3.3。 我用 boto 从 simpledb 收集数据,效果很好。 但是现在当我尝试 boto 连接到 s3 时出现错误。谁能指导我正确的方向。我真的不想降级我的 python,因为我的整个项目都在 python 3.3 中。
这是我写的命令列表:
>>> from boto.s3.key import Key
>>> k = Key(bucket)
>>> k.key='testfile'
>>> k.set_contents_from_string('Hello this is my Boto S3 Test')
这是我在执行最后一个命令时遇到的错误列表:
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
k.set_contents_from_string('Hello this is my Boto S3 Test')
File "C:\Python33\lib\site-packages\boto\s3\key.py", line 1060, in
set_contents_from_string
fp = compat.StringIO(s)
TypeError: initial_value must be str or None, not bytes
我一直遇到的其他问题(我猜root是一样的)在这个链接中给出:
【问题讨论】:
-
有一个py3kport 分支,也许你应该试试。正式发布的版本只有supports python2.5 - 2.7
-
是的,我猜。现在 Iv 意识到除了一些列表功能之外,python 3.3 并没有真正使用太多 Iv。猜猜我必须回到 2.7 :( 希望在 python 3.x 中 boto 有一些稳定的东西。
标签: python python-3.x boto