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 time
|
||||
import codecs
|
||||
import random
|
||||
import shutil
|
||||
import unittest
|
||||
|
@ -97,8 +98,9 @@ class CCTestTools(unittest.TestCase):
|
|||
|
||||
def writeconfig(self, case):
|
||||
f = ntf(prefix=case.tag, suffix='.cfg', dir=self.tempdir, delete=False)
|
||||
f.write(case.cfg)
|
||||
f.close()
|
||||
with codecs.open(f.name, 'w', encoding='utf-8') as fu:
|
||||
fu.write(case.cfg)
|
||||
case.configfile = f.name
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue