[python] Anyone familiar with the python pickle module? I’m getting this intermitten error when I try to unpickle and object class. via /r/learnprogramming


[python] Anyone familiar with the python pickle module? I’m getting this intermitten error when I try to unpickle and object class.

File "/usr/lib/python2.7/pickle.py", line 880, in marker while stack[k] is not mark: k = k-1

That is the error.

My code is basically

 class thing(): def __init__(self, x) self.x=x 

I pickle with:

 y=thing(x) z=pickle.dumps(y) 

(store z value in an AWS SQS queue)

 m=(read AWS sqs queue) r=pickle.loads(m) 

I get the error if I try to …

 print r.x 

Any clue whats going on? The script will run as expected most times but then i'll get the above error intermittenly.

I honestly have no idea where to even start.

Submitted July 09, 2017 at 04:03PM by findandwrite
via reddit http://ift.tt/2uZyXZs

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s