Removed binary flag to open files for writing text content
This commit is contained in:
parent
d2975718fe
commit
0dac73ebd7
@ -144,7 +144,7 @@ def write_pot_file(potfile, msgs, file, work_file, is_templatized):
|
|||||||
msgs = '\n'.join(dropwhile(len, msgs.split('\n')))
|
msgs = '\n'.join(dropwhile(len, msgs.split('\n')))
|
||||||
else:
|
else:
|
||||||
msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8')
|
msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8')
|
||||||
with open(potfile, 'ab') as fp:
|
with open(potfile, 'a') as fp:
|
||||||
fp.write(msgs)
|
fp.write(msgs)
|
||||||
|
|
||||||
def process_file(file, dirpath, potfile, domain, verbosity,
|
def process_file(file, dirpath, potfile, domain, verbosity,
|
||||||
@ -252,7 +252,7 @@ def write_po_file(pofile, potfile, domain, locale, verbosity, stdout,
|
|||||||
msgs = copy_plural_forms(msgs, locale, domain, verbosity, stdout)
|
msgs = copy_plural_forms(msgs, locale, domain, verbosity, stdout)
|
||||||
msgs = msgs.replace(
|
msgs = msgs.replace(
|
||||||
"#. #-#-#-#-# %s.pot (PACKAGE VERSION) #-#-#-#-#\n" % domain, "")
|
"#. #-#-#-#-# %s.pot (PACKAGE VERSION) #-#-#-#-#\n" % domain, "")
|
||||||
with open(pofile, 'wb') as fp:
|
with open(pofile, 'w') as fp:
|
||||||
fp.write(msgs)
|
fp.write(msgs)
|
||||||
os.unlink(potfile)
|
os.unlink(potfile)
|
||||||
if no_obsolete:
|
if no_obsolete:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user