[Python-Dev] 2.3a2 problem: iconv module raising RuntimeError

Hye-Shik Chang perky@fallin.lv
Sat, 22 Feb 2003 04:03:32 +0900


On Fri, Feb 21, 2003 at 07:15:51PM +0100, Walter D?rwald wrote:
> Neal Norwitz wrote:
> 
> >There are already 2 bug reports with the build failing because the
> >iconv module raises a RuntimeError.  A patch to setup.py is below.
> >The patch corrects the problem, but should anything else be done?  
> >
> >The problem is that iconv builds ok, but the iconv_open fails so 
> >the module initialization failed, IIRC.
> 
> The init function tries to find out whether the choosen
> internal encoding (which should be as close as possible to
> Pythons internal Unicode representation, i.e. Py_UNICODE) requires
> byte swapping or not. For this it encodes the character '\x01'
> from 'ASCII' to the chosen encoding.
> 
> Unfortunately 'ASCII' doesn't seem to be available on Solaris.
> One solution would be to try 'ISO8859-1' instead of 'ASCII'.
> (According to SF patch #670715 this works on Irix, while
> 'ASCII' doesn't). Another solution would be to test various
> encodings until one is found that works.
> 
> I'll change the test encoding to 'ISO8859-1' and we'll see
> what happens.

Sounds good. ISO8859-1 is available on every machines that I have.

> 
> To get a working build even if importing iconv_codec fails,
> should the import function raise an ImportError instead
> of a RunTimeError?

I prefer ImportError than RuntimeError. Even users who have broken
iconv library, should be able to run python.(without iconvcodec)

> 
> Bye,
>    Walter D?rwald
> 

Regards,

    Hye-Shik =)