diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-08-19 05:46:28 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-08-19 05:46:28 +0000 |
commit | d10771ec14a14a020341b7c80391c259dd4b6a5e (patch) | |
tree | 79f5e3f0321ce321d74b629bd436a4637a8cfe84 | |
parent | e4e4866ae4a7e698fc556dfbd671924fc3ff0be7 (diff) | |
download | portage-d10771ec14a14a020341b7c80391c259dd4b6a5e.tar.gz portage-d10771ec14a14a020341b7c80391c259dd4b6a5e.tar.bz2 portage-d10771ec14a14a020341b7c80391c259dd4b6a5e.zip |
Use portage.os and _encodings where appropriate.
svn path=/main/trunk/; revision=14094
-rw-r--r-- | pym/portage/glsa.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py index 008cb86dc..db297995d 100644 --- a/pym/portage/glsa.py +++ b/pym/portage/glsa.py @@ -2,12 +2,16 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -import os +import codecs import sys import urllib import re import xml.dom.minidom +from portage import os +from portage import _encodings +from portage import _unicode_decode +from portage import _unicode_encode from portage.versions import pkgsplit, catpkgsplit, pkgcmp, best from portage.util import grabfile from portage.const import CACHE_PATH @@ -435,6 +439,8 @@ class Glsa: @type portdbapi: portage.dbapi.porttree.portdbapi @param portdbapi: ebuild repository """ + myid = _unicode_decode(myid, + encoding=_encodings['content'], errors='strict') if re.match(r'\d{6}-\d{2}', myid): self.type = "id" elif os.path.exists(myid): @@ -647,7 +653,11 @@ class Glsa: @returns: None """ if not self.isApplied(): - checkfile = open(os.path.join(os.sep, self.config["ROOT"], CACHE_PATH.lstrip(os.sep), "glsa"), "a+") + checkfile = codecs.open( + _unicode_encode(os.path.join(os.sep, self.config["ROOT"], + CACHE_PATH.lstrip(os.sep), "glsa"), + encoding=_encodings['fs'], errors='strict'), + mode='a+', encoding=_encodings['content'], errors='strict') checkfile.write(self.nr+"\n") checkfile.close() return None |