Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41548 - dev-lang/python-2.3.3: xml.dom.minidom breaks for LANG=en and LANG=en_US
Summary: dev-lang/python-2.3.3: xml.dom.minidom breaks for LANG=en and LANG=en_US
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-14 04:10 UTC by Sascha Silbe
Modified: 2004-02-29 01:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Silbe 2004-02-14 04:10:47 UTC
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 Alastair Tse (RETIRED) gentoo-dev 2004-02-14 06:18:36 UTC
can't reproduce this. what version of 4Suite do you have?

LANG="en_US" python -c "import xml.dom.MessageSource"
Comment 2 Sascha Silbe 2004-02-14 06:25:23 UTC
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 Alastair Tse (RETIRED) gentoo-dev 2004-02-28 15:27:10 UTC
can you please try pyxml-0.8.3 ? this should be fixed with that version.
Comment 4 Sascha Silbe 2004-02-28 15:51:11 UTC
With pyxml-0.8.3 it works fine. Thanks!

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