views:

264

answers:

1

Hi to all, I need to save the context of the program before exiting ... I've put all the needed stuff to an object that I've previously created a I tried many times to picke it, but no way !! I continuously have errors like :

  • PicklingError: Can't pickle 'SRE_Match' object: <_sre.SRE_Match object at 0x2a969cd9c0>

  • OSError: [Errno 1] Operation not permitted: [the file that I am referencing is rwx for all]

the code that I use is :

f = open ("/remote/users5/amuharem/eclipse/important_stuff/amar/impo/tmp/contest.obj", 'w').close()
os.chmod("/remote/users5/amuharem/eclipse/important_stuff/amar/impo/tmp/contest.obj", 0777)
f = open ("/remote/users5/amuharem/eclipse/important_stuff/amar/impo/tmp/contest.obj", 'w')
pickle.dump(useCaseList, f)

Any knows how can I solve these problems or has another solution ?

Thanks in advance

+2  A: 

See the python doc What can be pickled and unpickled. You have objects that can not be pickled.

How about RTFM before posting a question ?

Bluebird75
From the FAQ: No question is too trivial or too "newbie". Oh yes, and it should be about programming. You know, with a computer.
saffsd