By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,621 Members | 1,104 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,621 IT Pros & Developers. It's quick & easy.

Pickle problem : Can't pickle 'SRE_Match' object:

P: 3
Hi to all, I have spent the whole morning trying, with no success to pickle an object that I have created.

The error that I get is : Can't pickle 'SRE_Match' object: <_sre.SRE_Match object at 0x2a969c0ad0>

the complete stack is the following :

Traceback (most recent call last):
File "manager.py", line 305, in ?
commandLineExec (log, parser)
File "manager.py", line 229, in commandLineExec
bestUseCase = logHandler.findTheLogsOn(useCaseList, fileInfoList, logRx, parser)
File "/remote/users5/amuharem/eclipse/important_stuff/amar/impo/logHandler.py", line 800, in findTheLogsOn
online (useCaseList, fileInfoList, logRx)
File "/remote/users5/amuharem/eclipse/important_stuff/amar/impo/logHandler.py", line 755, in online
findOtherLogs (useCaseList, i[1], i[0], logRx)
File "/remote/users5/amuharem/eclipse/important_stuff/amar/impo/logHandler.py", line 664, in findOtherLogs
log = matchTheLog (useCaseList, re.compile(specRegExp), useCaseIndex, msgIndex, logRx)
File "/remote/users5/amuharem/eclipse/important_stuff/amar/impo/logHandler.py", line 598, in matchTheLog
mmatch = multipleMatch(useCaseList, matches, useCaseIndex, msgIndex, logRx)
File "/remote/users5/amuharem/eclipse/important_stuff/amar/impo/logHandler.py", line 492, in multipleMatch
useCaseParse.pickleUseCaseList("/remote/users5/amuharem/eclipse/important_stuff/amar/impo/tmp/useCaseList.obj", useCaseList)
File "/remote/users5/amuharem/eclipse/important_stuff/amar/impo/useCaseParse.py", line 158, in pickleUseCaseList
pickle.dump(useCaseList[0], f)
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 1382, in dump
Pickler(file, protocol, bin).dump(obj)
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 231, in dump
self.save(obj)
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 293, in save
f(self, obj) # Call unbound method with explicit self
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 739, in save_inst
save(stuff)
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 293, in save
f(self, obj) # Call unbound method with explicit self
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 663, in save_dict
self._batch_setitems(obj.iteritems())
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 677, in _batch_setitems
save(v)
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 293, in save
f(self, obj) # Call unbound method with explicit self
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 614, in save_list
self._batch_appends(iter(obj))
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 629, in _batch_appends
save(x)
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 293, in save
f(self, obj) # Call unbound method with explicit self
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 739, in save_inst
save(stuff)
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 293, in save
f(self, obj) # Call unbound method with explicit self
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 663, in save_dict
self._batch_setitems(obj.iteritems())
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 677, in _batch_setitems
save(v)
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 293, in save
f(self, obj) # Call unbound method with explicit self
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 739, in save_inst
save(stuff)
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 293, in save
f(self, obj) # Call unbound method with explicit self
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 663, in save_dict
self._batch_setitems(obj.iteritems())
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 677, in _batch_setitems
save(v)
File "/nastools/python-2.4-64/lib/python2.4/pickle.py", line 319, in save
raise PicklingError("Can't pickle %r object: %r" %
PicklingError: Can't pickle 'SRE_Match' object: <_sre.SRE_Match object at 0x2a969c0ad0>



Is there anybody that can help me please ?
Thanks in advance, Amar.
May 6 '09 #1
Share this Question
Share on Google+
1 Reply


P: 3
I have the answer, it's all due to nested classes ! I have several nested classes and this is the reason why I am NOT able to pickle !
May 6 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.