Re: Strange KeyError using cPickle

2005-06-01 Thread Tim Peters
[Tim Peters] >> What is "XWwz"? Assuming it's a bizarre typo for "open", change the >> 'w' there to 'wb'. Pickles are binary data, and files holding pickles >> must be opened in binary mode, especially since: >> >>> ... >>> (on WinXP, CPython 2.4.1) [Rune Strand] > Thanks Tim. The bizarre 'typo

Re: Strange KeyError using cPickle

2005-06-01 Thread Rune Strand
[Tim Peters] > What is "XWwz"? Assuming it's a bizarre typo for "open", change the > 'w' there to 'wb'. Pickles are binary data, and files holding pickles > must be opened in binary mode, especially since: > > > ... > > (on WinXP, CPython 2.4.1) Thanks Tim. The bizarre 'typo' appears to be cause

Re: Strange KeyError using cPickle

2005-06-01 Thread Tim Peters
[Rune Strand] > I'm experiencing strange errors both with pickle and cPickle in the > below code: > > > import cPickle as pickle > #import pickle > from string import ascii_uppercase > from string import ascii_lowercase > > def createData(): >d1 = list("Something's rotten") >d2 = tuple('in

Strange KeyError using cPickle

2005-06-01 Thread Rune Strand
I'm experiencing strange errors both with pickle and cPickle in the below code: import cPickle as pickle #import pickle from string import ascii_uppercase from string import ascii_lowercase def createData(): d1 = list("Something's rotten") d2 = tuple('in the state of Denmark') d3 =