remove unittest2 and fix various warnings in py3

This commit is contained in:
Deniz Turgut 2013-04-13 16:36:05 -04:00
commit bc4bd773a0
10 changed files with 76 additions and 61 deletions

View file

@ -192,7 +192,8 @@ class pelican_open(object):
self.filename = filename
def __enter__(self):
content = open(self.filename, encoding='utf-8').read()
with open(self.filename, encoding='utf-8') as infile:
content = infile.read()
if content[0] == BOM_UTF8.decode('utf8'):
content = content[1:]
return content