Manual pass on sources for better standards.

This commit is contained in:
Alexis Métaireau 2013-03-03 20:12:31 -08:00
commit 519dcdbcb3
9 changed files with 136 additions and 105 deletions

View file

@ -78,11 +78,11 @@ class Writer(object):
os.makedirs(os.path.dirname(complete_path))
except Exception:
pass
fp = open(complete_path, 'w', encoding='utf-8' if six.PY3 else None)
feed.write(fp, 'utf-8')
logger.info('writing %s' % complete_path)
fp.close()
encoding = 'utf-8' if six.PY3 else None
with open(complete_path, 'w', encoding=encoding) as fp:
feed.write(fp, 'utf-8')
logger.info('writing %s' % complete_path)
return feed
finally:
locale.setlocale(locale.LC_ALL, old_locale)