unpickle error

Richie Hindle richie at entrian.com
Mon Jun 28 09:06:36 EDT 2004


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

-- 
Richie Hindle
richie at entrian.com





More information about the Python-list mailing list