Skip to content

Commit

Permalink
Change the test encoding from "ISO8859-1" to "ISO-8859-1"
Browse files Browse the repository at this point in the history
(see SF bug #690309) and raise ImportErrors instead of
RuntimeErrors, so building Python continues even
if importing iconv_codecs fails.

This is a temporary fix until we get proper configure
support for "broken" iconv implementations.
  • Loading branch information
doerwalter committed Feb 24, 2003
1 parent 0f69833 commit dd8766a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Modules/_iconv_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,17 +671,17 @@ init_iconv_codec(void)
size_t outsize = sizeof(out);
size_t res;

iconv_t hdl = iconv_open(UNICODE_ENCODING, "ISO8859-1");
iconv_t hdl = iconv_open(UNICODE_ENCODING, "ISO-8859-1");

if (hdl == (iconv_t)-1) {
PyErr_SetString(PyExc_RuntimeError,
PyErr_SetString(PyExc_ImportError,
"can't initialize the _iconv_codec module: iconv_open() failed");
return;
}

res = iconv(hdl, &inptr, &insize, &outptr, &outsize);
if (res == (size_t)-1) {
PyErr_SetString(PyExc_RuntimeError,
PyErr_SetString(PyExc_ImportError,
"can't initialize the _iconv_codec module: iconv() failed");
return;
}
Expand All @@ -698,7 +698,7 @@ init_iconv_codec(void)
byteswap = 1;
else {
iconv_close(hdl);
PyErr_SetString(PyExc_RuntimeError,
PyErr_SetString(PyExc_ImportError,
"can't initialize the _iconv_codec module: mixed endianess");
return;
}
Expand Down

0 comments on commit dd8766a

Please sign in to comment.