unpickle error

sosman news01 at metrak.KILLSPAM.com
Tue Jun 29 04:27:44 EDT 2004


Richie Hindle wrote:

> [sosman]
> 
>>After pickling several lists of objects using protocol 2, when I 
>>unpickle I get:
>>TypeError: ord() expected a character, but string of length 0 found
>>
>>When I use protocol 0 (ascii) this doesn't occur.
> 
> 
> On Windows you need to open your files in binary mode using open(name, 'rb')
> or open(name, 'wb') when reading and writing non-ASCII data.  Could that be
> the problem?

Doh.  Thank you, that appears to have done the trick.


-- 
brewiki: http://www.metrak.com/wiki/homebrew/



More information about the Python-list mailing list