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

Walter Dörwald walter@livinglogic.de
Fri, 21 Feb 2003 19:15:51 +0100


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.

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

Bye,
    Walter Dörwald