encoding hell - any chance of salvation ?

Tom Zych freethinker at pobox.com
Mon Mar 7 06:38:50 EST 2011


southof40 wrote:
> ...
>         result = array('u')
> ...
> ... and results in the error"TypeError: array item must be unicode
> character" is raised (full stack trace at bottom) .
> ...
> Can anyone make a suggestion as to the best way to allow the array
> object to accept what is in essence a binary file ?

Glancing at the docs, it appears you want to use 'c', 'b', or 'B'
instead of 'u' when creating array.

-- 
Tom Zych / freethinker at pobox.com
"Would you like a lovely fluffy little white rabbit, little girl,
or a cutesy wootesly little brown rabbit?"
"Actually, I don't think my python would notice."



More information about the Python-list mailing list