Re: [Tutor] Stacks and Stack underflow/Stack overflow

2011-11-19 Thread Walter Prins
Hi Steve/Joe, On 20 November 2011 00:09, Steven D'Aprano wrote: > Walter Prins wrote: > > pickle files are binary files and you probably opened it as a text file. >> See here: >> http://docs.python.org/py3k/**library/functions.html#open

Re: [Tutor] Stacks and Stack underflow/Stack overflow

2011-11-19 Thread Hugo Arts
On Sun, Nov 20, 2011 at 2:29 AM, Alan Gauld wrote: > On 20/11/11 00:09, Steven D'Aprano wrote: >> >> Walter Prins wrote: >> >>> pickle files are binary files and you probably opened it as a text file. >>> See here: http://docs.python.org/py3k/library/functions.html#open >> >> Not so. Pickle protoc

Re: [Tutor] Stacks and Stack underflow/Stack overflow

2011-11-19 Thread Alan Gauld
On 20/11/11 00:09, Steven D'Aprano wrote: Walter Prins wrote: pickle files are binary files and you probably opened it as a text file. See here: http://docs.python.org/py3k/library/functions.html#open Not so. Pickle protocol 0 is text, and it happens to be the default protocol used if you don

Re: [Tutor] Stacks and Stack underflow/Stack overflow

2011-11-19 Thread Steven D'Aprano
Walter Prins wrote: pickle files are binary files and you probably opened it as a text file. See here: http://docs.python.org/py3k/library/functions.html#open Not so. Pickle protocol 0 is text, and it happens to be the default protocol used if you don't instruct it different. So by default, p

Re: [Tutor] Stacks and Stack underflow/Stack overflow

2011-11-19 Thread Steven D'Aprano
Joe Batt wrote: Hi All Could some kind soul please explain why you get a stack underflow and a stack overflow. I don't, because I never make misteaks. *grin* Stack underflow and stack overflow are generic errors. You get a stack underflow when you have (say) five items on a stack and try to

Re: [Tutor] Stacks and Stack underflow/Stack overflow

2011-11-19 Thread Alan Gauld
On 19/11/11 19:37, Joe Batt wrote: File "/Users/joebatt/Desktop/python/pickling puzzle 5.py", line 39, in 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') I do

Re: [Tutor] Stacks and Stack underflow/Stack overflow

2011-11-19 Thread Walter Prins
Hi, On 19 November 2011 19:37, Joe Batt wrote: > 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 > > a=pickle.load(file) > _pickle.UnpicklingError: unpickling stack underflow > >

Re: [Tutor] Stacks and Stack underflow/Stack overflow

2011-11-19 Thread Terry Carroll
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     a=p