Revision 346665373332 () - Diff

Link to this snippet: https://friendpaste.com/34SqUc2zfk2Pk9Ysvb6BRI
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
In [29]: from pymongo.dbref import DBRef

In [30]: a = {'foo': DBRef(collection='bla', database='bar', id='goo')}


In [35]: deepcopy(a)
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)

/home/namlook/Documents/projets/mongokit-hg/mongokit/<ipython console> in <module>()

/usr/lib/python2.6/copy.pyc in deepcopy(x, memo, _nil)
160 copier = _deepcopy_dispatch.get(cls)
161 if copier:
--> 162 y = copier(x, memo)
163 else:
164 try:

/usr/lib/python2.6/copy.pyc in _deepcopy_dict(x, memo)
253 memo[id(x)] = y
254 for key, value in x.iteritems():
--> 255 y[deepcopy(key, memo)] = deepcopy(value, memo)
256 return y
257 d[dict] = _deepcopy_dict

/usr/lib/python2.6/copy.pyc in deepcopy(x, memo, _nil)
169 y = _deepcopy_atomic(x, memo)
170 else:
--> 171 copier = getattr(x, "__deepcopy__", None)
172 if copier:
173 y = copier(memo)

/usr/local/lib/python2.6/dist-packages/pymongo-1.9-py2.6-linux-i686.egg/bson/dbref.pyc in __getattr__(self, key)
79
80 def __getattr__(self, key):
---> 81 return self.__kwargs[key]
82
83 def as_doc(self):

KeyError: '__deepcopy__'