From d9e7593ee3e400ef784939b6ba9e195ebcd77c72 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Fri, 14 Nov 2008 20:42:35 +0000 Subject: layman-1.2.0-r1, TR locale error (#235165) http://bugs.gentoo.org/show_bug.cgi?id=235165 --- ChangeLog | 7 +++++++ layman/action.py | 12 ++++++++---- layman/overlays/overlay.py | 5 +++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4cedfc7..c0da5db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2008-11-14 Gunnar Wrobel + * layman/overlays/overlay.py: layman-1.2.0-r1, TR locale + error (#235165) + http://bugs.gentoo.org/show_bug.cgi?id=235165 + + * layman/action.py: layman-1.2.0-r1, TR locale error (#235165) + http://bugs.gentoo.org/show_bug.cgi?id=235165 + * layman/db.py (DB.add): Do not remove directories if adding an overlay failed (#236945) http://bugs.gentoo.org/show_bug.cgi?id=236945 diff --git a/layman/action.py b/layman/action.py index d5bd032..b472114 100644 --- a/layman/action.py +++ b/layman/action.py @@ -96,7 +96,8 @@ class Sync: self.selection = self.db.overlays.keys() enc = sys.getfilesystemencoding() - self.selection = [i.decode(enc) for i in self.selection] + if enc: + self.selection = [i.decode(enc) for i in self.selection] def run(self): '''Synchronize the overlays.''' @@ -157,7 +158,8 @@ class Add: self.selection = config['add'] enc = sys.getfilesystemencoding() - self.selection = [i.decode(enc) for i in self.selection] + if enc: + self.selection = [i.decode(enc) for i in self.selection] if 'ALL' in self.selection: self.selection = self.rdb.overlays.keys() @@ -204,7 +206,8 @@ class Delete: self.selection = config['delete'] enc = sys.getfilesystemencoding() - self.selection = [i.decode(enc) for i in self.selection] + if enc: + self.selection = [i.decode(enc) for i in self.selection] if 'ALL' in self.selection: self.selection = self.db.overlays.keys() @@ -281,7 +284,8 @@ class Info: self.selection = config['info'] enc = sys.getfilesystemencoding() - self.selection = [i.decode(enc) for i in self.selection] + if enc: + self.selection = [i.decode(enc) for i in self.selection] if 'ALL' in self.selection: self.selection = self.rdb.overlays.keys() diff --git a/layman/overlays/overlay.py b/layman/overlays/overlay.py index 14aaa94..56186d8 100644 --- a/layman/overlays/overlay.py +++ b/layman/overlays/overlay.py @@ -154,8 +154,9 @@ class Overlay: OUT.info('Running command "' + command + '"...', 2) if hasattr(sys.stdout,'encoding'): - command = command.encode(sys.stdout.encoding or - sys.getfilesystemencoding()) + enc = sys.stdout.encoding or sys.getfilesystemencoding() + if enc: + command = command.encode(enc) if not self.quiet: return os.system(command) -- cgit v1.2.3-1-g7c22