string.encode on HP-UX

Richard Townsend richardt at
Fri Jul 23 10:09:22 CEST 2004

In article <Pine.LNX.4.44.0407221014000.30237-100000 at>,
Christopher T King <squirrel at WPI.EDU> writes

>Oops, I had only tested it at the prompt :P I had assumed 
>was run after everything was set up.
>This code uses a more defined interface for altering the codecs registry, 
>uses 'ascii' instead of 'latin_1' (to prevent some confusion), and 
>I've actually tested it in
>import codecs
>def roman8(n):
>    if n=='roman8':
>        return codecs.lookup('ascii')
>This achieves the same effect as the aliases trick (which I'm surprised 
>didn't work for you at the prompt), but is less tricksy and should 
>therefore work better.

Hi Christopher,

Thanks for your new suggestion. I have tested it on HP-UX and it doesn't
raise the exception anymore.


Richard Townsend

More information about the Python-list mailing list