All of lore.kernel.org
 help / color / mirror / Atom feed
* translation patch for semanage
@ 2007-01-11 14:09 Daniel J Walsh
  2007-01-11 18:33 ` Karl MacMillan
  2007-01-16 15:46 ` Karl MacMillan
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel J Walsh @ 2007-01-11 14:09 UTC (permalink / raw)
  To: SE Linux, Stephen Smalley

[-- Attachment #1: Type: text/plain, Size: 53 bytes --]

This patch works around a unicode problem in python.

[-- Attachment #2: policycoreuitls-semanage.patch --]
[-- Type: text/x-patch, Size: 865 bytes --]

--- nsapolicycoreutils/semanage/semanage	2006-11-16 17:14:26.000000000 -0500
+++ policycoreutils-1.33.10/semanage/semanage	2007-01-09 11:55:52.000000000 -0500
@@ -23,12 +23,21 @@
 import os, sys, getopt
 import seobject
 import selinux
+PROGNAME="policycoreutils"
+
 import gettext
+gettext.bindtextdomain(PROGNAME, "/usr/share/locale")
+gettext.textdomain(PROGNAME)
+import codecs
+import locale
+sys.stderr = codecs.getwriter(locale.getpreferredencoding())(sys.__stderr__, 'replace')
+sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.__stdout__, 'replace')
 
 try:
-       gettext.install('policycoreutils')
-except:
-       pass
+       gettext.install(PROGNAME, localedir="/usr/share/locale", unicode=1)
+except IOError:
+       import __builtin__
+       __builtin__.__dict__['_'] = unicode
 
 is_mls_enabled=selinux.is_selinux_mls_enabled()
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-01-16 15:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-11 14:09 translation patch for semanage Daniel J Walsh
2007-01-11 18:33 ` Karl MacMillan
2007-01-11 21:20   ` Daniel J Walsh
2007-01-16 15:46 ` Karl MacMillan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.