[Tutor] Stacks and Stack underflow/Stack overflow

Terry Carroll carroll at tjc.com
Sat Nov 19 21:26:32 CET 2011


On Sat, 19 Nov 2011, Joe Batt wrote:

> Hi All 
> Could some kind soul please explain why you get a stack underflow and a
> stack overflow.
> 
> I am getting the following error in Python 3
> 
> Traceback (most recent call last):
>   File "/Users/joebatt/Desktop/python/pickling puzzle 5.py", line 39, in
> <module>
>     a=pickle.load(file)
> _pickle.UnpicklingError: unpickling stack underflow
> 
> when I am running the following
> 
> import pickle
> file=open('///Users/joebatt/Desktop/banner.p.webarchive','rb')
> a=pickle.load(file)
> file.close()
> print (a)

When you created the pickle file, did you create it in binary form (with 
"wb")?


More information about the Tutor mailing list