unpickle error

Richie Hindle richie at entrian.com
Mon Jun 28 15:06:36 CEST 2004

> 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?

Richie Hindle
richie at entrian.com

More information about the Python-list mailing list