Weirdness when changing languages (with solution)

Juan Carlos Castro y Castro <[email protected]>
Newsgroups gmane.linux.tao.general
Message-ID <[email protected]>
I decided to change the default language of my Tao install from en_US to pt_BR, and did so editing 
/etc/sysconfig/i18n. When I rebooted, I saw there were errors when cups started. The cause was the 
following:

The redhat-config-printer packaghe has a Python script, /usr/share/printconf/util/cups_import.py, 
which defines the following function:

def which_spooler ():
     """Return the name of the active spooler."""
     signal.signal (signal.SIGCHLD, signal.SIG_DFL)
     f = os.popen ('/usr/sbin/alternatives --display print')
     for l in f.readlines ():
         if l.startswith (" link currently points to"):
             which = l.split ('.')[1].strip ()
             break
 

     f.close ()
     return which

You may have already noticed what the problem is: this assumes the output of the "alternatives" 
command is in the English language. It may not be so. I edited the script to be like this:

def which_spooler ():
     """Return the name of the active spooler."""
     signal.signal (signal.SIGCHLD, signal.SIG_DFL)
     f = os.popen ('LANG=en /usr/sbin/alternatives --display print')
     for l in f.readlines ():
         if l.startswith (" link currently points to"):
             which = l.split ('.')[1].strip ()
             break
 

     f.close ()
     return which

Now the output of the command is FORCED to be in English no matter what. Bug squashed.

-- 
Juan Carlos Castro y Castro
Desenvolvimento de Software
Gisplan Tecnologia da Geoinformação Ltda. - http://www.gisplan.com.br
Av. Armando Lombardi, 800/311 - Barra da Tijuca
Rio de Janeiro - RJ - 22640-020
Tel: (0xx21) 2494-2838  Fax: (0xx21) 2495-0728

_______________________________________________
Tao-discuss mailing list
[email protected]
http://mailman.taolinux.org/mailman/listinfo/tao-discuss
signature.asc (application/pgp-signature, 252 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBpPeXaM7yIXrRc3QRAl+TAKCev3jZob2XejJY/Sq7yojbJylPaQCfVMx9
M4g5LurkzPFghdtj/vxcUaA=
=Bxt5
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.