for idx, (locale, po_file) in enumerate(po_files):
mo_file = mo_files[idx]
- infile = open(po_file, 'r')
+ infile = open(po_file, 'rb')
try:
catalog = read_po(infile, locale)
finally:
log.info('creating catalog %r based on %r', self.output_file,
self.input_file)
- infile = open(self.input_file, 'r')
+ infile = open(self.input_file, 'rb')
try:
# Although reading from the catalog template, read_po must be fed
# the locale in order to correctly calculate plurals
if not domain:
domain = os.path.splitext(os.path.basename(self.input_file))[0]
- infile = open(self.input_file, 'U')
+ infile = open(self.input_file, 'rb')
try:
template = read_po(infile)
finally:
for locale, filename in po_files:
log.info('updating catalog %r based on %r', filename,
self.input_file)
- infile = open(filename, 'U')
+ infile = open(filename, 'rb')
try:
catalog = read_po(infile, locale=locale, domain=domain)
finally:
tmpname = os.path.join(os.path.dirname(filename),
tempfile.gettempprefix() +
os.path.basename(filename))
- tmpfile = open(tmpname, 'w')
+ tmpfile = open(tmpname, 'wb')
try:
try:
write_po(tmpfile, catalog,
for idx, (locale, po_file) in enumerate(po_files):
mo_file = mo_files[idx]
- infile = open(po_file, 'r')
+ infile = open(po_file, 'rb')
try:
catalog = read_po(infile, locale)
finally: