[XML-SIG] CHARSET and Python 2.3
Andrew Dalke
dalke@dalkescientific.com
Sun, 25 May 2003 21:42:34 -0600
The _xmlplus package doesn't work under Python 2.3 where it works under =20=
2.2.
It appears to be because of the gettext entry, which contains a =20
"charset:"
of "CHARSET", which 2.3 doesn't like.
Details below.
# First, it works under Python 2.2
[Andrew-Dalkes-Computer:~/ftps/SOAPpy-0.10.1] dalke% env =20
PYTHONPATH=3D/usr/local/lib/python2.3/site-packages python2.2
Python 2.2 (#1, 07/14/02, 23:25:09)
[GCC Apple cpp-precomp 6.14] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import xml.dom.minidom
>>> import xml
>>> xml.__file__
'/usr/local/lib/python2.3/site-packages/_xmlplus/__init__.py'
>>> ^D
# but not under 2.3
[Andrew-Dalkes-Computer:~/ftps/SOAPpy-0.10.1] dalke% python2.3
Python 2.3b1+ (#9, May 7 2003, 23:33:14)
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import xml.dom.minidom
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File =20
"/usr/local/lib/python2.3/site-packages/_xmlplus/dom/__init__.py", line =20=
237, in ?
import MessageSource
File =20
"/usr/local/lib/python2.3/site-packages/_xmlplus/dom/MessageSource.py", =20=
line 22, in ?
gettext.install('4Suite', locale_dir)
File "/usr/local/lib/python2.3/gettext.py", line 423, in install
translation(domain, localedir, fallback=3DTrue).install(unicode)
File "/usr/local/lib/python2.3/gettext.py", line 411, in translation
t =3D _translations.setdefault(key, class_(open(mofile, 'rb')))
File "/usr/local/lib/python2.3/gettext.py", line 176, in __init__
self._parse(fp)
File "/usr/local/lib/python2.3/gettext.py", line 299, in _parse
tmsg =3D unicode(tmsg, self._charset)
LookupError: unknown encoding: CHARSET
>>> import xml
>>> xml.__file__
'/usr/local/lib/python2.3/site-packages/_xmlplus/__init__.pyc'
>>> xml.__version__
'0.8.2'
# The gettext for my 'en-US' locale is
[Andrew-Dalkes-Computer:~/ftps/SOAPpy-0.10.1] dalke% cat =20
/usr/local/lib/python2.3//site-packages/_xmlplus/dom/en_US/LC_MESSAGES/=20=
4Suite.mo
=A1Z=A1Z$,-Project-Id-Version: PACKAGE VERSION
PO-Revision-Date: Sun Feb 18 17:52:04 2001
Last-Translator: FULL NAME <EMAIL@ADDRESS>
Language-Team: LANGUAGE <LL@li.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=3DCHARSET
Content-Transfer-Encoding: ENCODING
Generated-By: pygettext.py 1.1
[Andrew-Dalkes-Computer:~/ftps/SOAPpy-0.10.1] dalke%
# If I change the 'CHARSET' to 'Latin-1' I have no problem.
This 4Suite.mo file in CVS also has 'CHARSET', so I assume there
is still a problem.
Neither Google nor alltheweb found references to this exception
message.
Andrew
dalke@dalkescientific.com