import portage
from portage import os
+from portage import _encodings
+from portage import _unicode_encode
def calc_changelog(ebuildpath,current,next):
if ebuildpath == None or not os.path.exists(ebuildpath):
next = next[:-3]
changelogpath = os.path.join(os.path.split(ebuildpath)[0],'ChangeLog')
try:
- changelog = codecs.open(portage._unicode_encode(changelogpath),
- mode='r', encoding='utf_8', errors='replace').read()
+ changelog = codecs.open(_unicode_encode(changelogpath,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'], errors='replace'
+ ).read()
except SystemExit, e:
raise # Needed else can't exit
except:
import time
import portage
from portage import os
+from portage import _encodings
+from portage import _unicode_encode
from portage.data import secpass
from portage.output import xtermTitle
xtermTitle(short_msg)
try:
file_path = os.path.join(_emerge_log_dir, 'emerge.log')
- mylogfile = codecs.open(portage._unicode_encode(file_path), mode='a',
- encoding='utf_8', errors='replace')
+ mylogfile = codecs.open(_unicode_encode(file_path,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='a', encoding=_encodings['content'],
+ errors='backslashreplace')
portage.util.apply_secpass_permissions(file_path,
uid=portage.portage_uid, gid=portage.portage_gid,
mode=0660)