我试图将插入到 MongoDB 作为安全写入,但我收到了未经授权的错误消息 (MongoDB 2.2 & Pymongo 2.2)。升级到 Pymongo 2.3 后,那个消失了,但我收到了另一条带有以下跟踪的消息:
MongoDB['my_collection'].save({'test' : 1111111} , safe = True)
File "D:\Python24\Lib\site-packages\pymongo\collection.py", line 241, in save
return self.insert(to_save, manipulate, safe, check_keys, **kwargs)
File "D:\Python24\Lib\site-packages\pymongo\collection.py", line 315, in insert
continue_on_error, self.__uuid_subtype), safe)
File "D:\Python24\Lib\site-packages\pymongo\connection.py", line 831, in _send_message
rv = self.__check_response_to_last_error(response)
File "D:\Python24\Lib\site-packages\pymongo\connection.py", line 753, in __check_response_to_last_error
response = helpers._unpack_response(response)
File "D:\python24\lib\site-packages\pymongo\helpers.py", line 111, in _unpack_response
as_class, tz_aware, uuid_subtype)
SystemError: bad format char passed to Py_BuildValue
如果我转动 safe=False
一切都很好。
任何关于此的想法都会有所帮助。
谢谢,