mirror of https://github.com/tLDP/python-tldp
prepare to support Python3 and Python2 (utf-8 all in/out)
This commit is contained in:
parent
5824be20da
commit
d99448609d
|
@ -3,6 +3,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
import codecs
|
||||||
import random
|
import random
|
||||||
import shutil
|
import shutil
|
||||||
import unittest
|
import unittest
|
||||||
|
@ -97,8 +98,9 @@ class CCTestTools(unittest.TestCase):
|
||||||
|
|
||||||
def writeconfig(self, case):
|
def writeconfig(self, case):
|
||||||
f = ntf(prefix=case.tag, suffix='.cfg', dir=self.tempdir, delete=False)
|
f = ntf(prefix=case.tag, suffix='.cfg', dir=self.tempdir, delete=False)
|
||||||
f.write(case.cfg)
|
|
||||||
f.close()
|
f.close()
|
||||||
|
with codecs.open(f.name, 'w', encoding='utf-8') as fu:
|
||||||
|
fu.write(case.cfg)
|
||||||
case.configfile = f.name
|
case.configfile = f.name
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue