Bug 41548 - dev-lang/python-2.3.3: xml.dom.minidom breaks for LANG=en and LANG=en_US
Bug#: 41548 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: All Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: python@gentoo.org Reported By: sascha-gentoo-bugzilla@silbe.org
Component: Applications
URL: 
Summary: dev-lang/python-2.3.3: xml.dom.minidom breaks for LANG=en and LANG=en_US
Keywords:  
Status Whiteboard: 
Opened: 2004-02-14 04:10 0000
Description:   Opened: 2004-02-14 04:10 0000
If the environment variable LANG is set to "en" or "en_US", xml.dom.minidom
breaks:

=== Begin ===
sascha@cube:~/firma/arch/profiles--mainstream--1.0/tools$ LANG=en_US
./genconfig.py 
Traceback (most recent call last):
  File "./genconfig.py", line 3, in ?
    import xml.dom.minidom
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/__init__.py", line 237,
in ?
    import MessageSource
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/MessageSource.py", line
22, in ?
    gettext.install('4Suite', locale_dir)
  File "/usr/lib/python2.3/gettext.py", line 428, in install
    translation(domain, localedir, fallback=True).install(unicode)
  File "/usr/lib/python2.3/gettext.py", line 416, in translation
    t = _translations.setdefault(key, class_(open(mofile, 'rb')))
  File "/usr/lib/python2.3/gettext.py", line 176, in __init__
    self._parse(fp)
  File "/usr/lib/python2.3/gettext.py", line 304, in _parse
    tmsg = unicode(tmsg, self._charset)
LookupError: unknown encoding: CHARSET
sascha@cube:~/firma/arch/profiles--mainstream--1.0/tools$ LANG=en
./genconfig.py 
Traceback (most recent call last):
  File "./genconfig.py", line 3, in ?
    import xml.dom.minidom
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/__init__.py", line 237,
in ?
    import MessageSource
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/MessageSource.py", line
22, in ?
    gettext.install('4Suite', locale_dir)
  File "/usr/lib/python2.3/gettext.py", line 428, in install
    translation(domain, localedir, fallback=True).install(unicode)
  File "/usr/lib/python2.3/gettext.py", line 416, in translation
    t = _translations.setdefault(key, class_(open(mofile, 'rb')))
  File "/usr/lib/python2.3/gettext.py", line 176, in __init__
    self._parse(fp)
  File "/usr/lib/python2.3/gettext.py", line 304, in _parse
    tmsg = unicode(tmsg, self._charset)
LookupError: unknown encoding: CHARSET
=== End ===

With LANG set to anything else it works:

sascha@cube:~/firma/arch/profiles--mainstream--1.0/tools$ LANG=de
./genconfig.py 
Syntax: genconfig.py <hostName>
sascha@cube:~/firma/arch/profiles--mainstream--1.0/tools$ LANG=garbage
./genconfig.py 
Syntax: genconfig.py <hostName>




Reproducible: Always
Steps to Reproduce:
1. LANG=en python
2. import xml.dom.minidom
3.

Actual Results:  
sascha@cube:~/firma/arch/profiles--mainstream--1.0/tools$ LANG=en python
Python 2.3.3 (#1, Jan 27 2004, 12:54:18) 
[GCC 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xml.dom.minidom
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/__init__.py", line 237,
in ?
    import MessageSource
  File "/usr/lib/python2.3/site-packages/_xmlplus/dom/MessageSource.py", line
22, in ?
    gettext.install('4Suite', locale_dir)
  File "/usr/lib/python2.3/gettext.py", line 428, in install
    translation(domain, localedir, fallback=True).install(unicode)
  File "/usr/lib/python2.3/gettext.py", line 416, in translation
    t = _translations.setdefault(key, class_(open(mofile, 'rb')))
  File "/usr/lib/python2.3/gettext.py", line 176, in __init__
    self._parse(fp)
  File "/usr/lib/python2.3/gettext.py", line 304, in _parse
    tmsg = unicode(tmsg, self._charset)
LookupError: unknown encoding: CHARSET
>>> 


Expected Results:  
Import the xml.dom.minidom Python module.



Gentoo Base System version 1.4.3.13
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.23-cube-2)
=================================================================
System uname: 2.4.23-cube-2 i686 AMD Athlon(tm) processor
distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632)
[disabled]
Autoconf: sys-devel/autoconf-2.58
Automake: sys-devel/automake-1.7.7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium -mcpu=athlon-tbird -O3 -pipe"
CHOST="i586-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config
/usr/share/config /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/vice/etc /var/qmail/alias
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/afs/C /etc/afs/afsws /etc/afs/modload /etc/gconf
/etc/make.globals /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox strict userpriv usersandbox"
GENTOO_MIRRORS="ftp://ftp.easynet.nl/mirror/gentoo/ http://gentoo.inode.at/
ftp://gentoo.inode.at/source/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://hybrid.sascha.silbe.org/gentoo-portage"
USE="3dnow X acl afs apm avi berkdb cdr crypt dga doc dvd encode foomaticdb
gdbm gif gtk gtk2 gtkhtml guile hbci imap imlib ipv6 j-noaim j-nomsn j-noyahoo
jpeg kde krb4 lcms libg++ libwww linguas_en,de mad maildir mbox mikmod mmx
monitor mozilla mpeg mysql nas ncurses nls oggvorbis opengl oss pam pdflib png
postgres python qt qtmt quicktime readline samba sdl skey spell ssl tetex tiff
truetype x86 xml xml2 xv zlib"

------- Comment #1 From Alastair Tse (RETIRED) 2004-02-14 06:18:36 0000 -------
can't reproduce this. what version of 4Suite do you have?

LANG="en_US" python -c "import xml.dom.MessageSource"

------- Comment #2 From Sascha Silbe 2004-02-14 06:25:23 0000 -------
I do not have 4suite installed:

*  dev-python/4suite
      Latest version available: 1.0_alpha3
      Latest version installed: [ Not Installed ]
      Size of downloaded files: 2,290 kB
      Homepage:    http://www.4suite.org/
      Description: Python tools for XML processing and object-databases.
      License:     Apache-1.1


But I do have dev-python/pyxml-0.8.2 installed and /usr/lib/python2.3/site-packages/_xmlplus/dom/MessageSource.py belongs to it:

sascha@cube:~$ qpkg -v -f /usr/lib/python2.3/site-packages/_xmlplus/dom/MessageSource.py 
dev-python/pyxml-0.8.2 *



------- Comment #3 From Alastair Tse (RETIRED) 2004-02-28 15:27:10 0000 -------
can you please try pyxml-0.8.3 ? this should be fixed with that version.

------- Comment #4 From Sascha Silbe 2004-02-28 15:51:11 0000 -------
With pyxml-0.8.3 it works fine. Thanks!


------- Comment #5 From Alastair Tse (RETIRED) 2004-02-29 01:16:06 0000 -------
thanks for getting back. i've bumped 0.8.3 to stable now.