|
|
|
@ -5718,13 +5718,14 @@ gettext -d cl_template "$*"
|
|
|
|
|
templateFile = pathJoin(self._baseDir, templateFile)
|
|
|
|
|
foundTemplateFile = os.path.exists(templateFile)
|
|
|
|
|
buff = None
|
|
|
|
|
buff_is_unicode = False
|
|
|
|
|
fMode, fUid, fGid = None, None, None
|
|
|
|
|
if foundTemplateFile and objHeadNew.params[HParams.Link]:
|
|
|
|
|
try:
|
|
|
|
|
F_CONF = self.openTemplFile(templateFile)
|
|
|
|
|
if not F_CONF:
|
|
|
|
|
raise IOError
|
|
|
|
|
buff, ___ = try_decode_utf8(F_CONF.read())
|
|
|
|
|
buff, buff_is_unicode = try_decode_utf8(F_CONF.read())
|
|
|
|
|
F_CONF.close()
|
|
|
|
|
fMode, fUid, fGid = getModeFile(templateFile)
|
|
|
|
|
except (OSError, IOError):
|
|
|
|
@ -5745,7 +5746,7 @@ gettext -d cl_template "$*"
|
|
|
|
|
return [], False
|
|
|
|
|
if buff is not None:
|
|
|
|
|
try:
|
|
|
|
|
mode = "wb+" if isinstance(buff, bytes) else "w+"
|
|
|
|
|
mode = "wb+" if not buff_is_unicode else "w+"
|
|
|
|
|
with open(pathOldFile, mode) as FD:
|
|
|
|
|
newBuffer = buff
|
|
|
|
|
FD.write(buff)
|
|
|
|
|