mirror of https://github.com/tLDP/python-tldp
switch to codecs.open and expect UTF-8 data
This commit is contained in:
parent
dcb8b3a217
commit
daf272a329
|
@ -97,11 +97,11 @@ class CCTestTools(unittest.TestCase):
|
||||||
shutil.rmtree(self.tempdir)
|
shutil.rmtree(self.tempdir)
|
||||||
|
|
||||||
def writeconfig(self, case):
|
def writeconfig(self, case):
|
||||||
f = ntf(prefix=case.tag, suffix='.cfg', dir=self.tempdir, delete=False)
|
tf = ntf(prefix=case.tag, suffix='.cfg', dir=self.tempdir, delete=False)
|
||||||
f.close()
|
tf.close()
|
||||||
with codecs.open(f.name, 'w', encoding='utf-8') as fu:
|
with codecs.open(tf.name, 'w', encoding='utf-8') as f:
|
||||||
fu.write(case.cfg)
|
f.write(case.cfg)
|
||||||
case.configfile = f.name
|
case.configfile = tf.name
|
||||||
|
|
||||||
|
|
||||||
class TestOutputDirSkeleton(OutputNamingConvention):
|
class TestOutputDirSkeleton(OutputNamingConvention):
|
||||||
|
@ -140,7 +140,7 @@ class TestSourceDocSkeleton(object):
|
||||||
if os.path.isfile(content):
|
if os.path.isfile(content):
|
||||||
shutil.copy(content, fname)
|
shutil.copy(content, fname)
|
||||||
else:
|
else:
|
||||||
with open(fname, 'w') as f:
|
with codecs.open(fname, 'w', encodeing='utf-8') as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue