HTMLTestRunner.py引用报错(StringIO)
报错原因:Python3 已将 stringIO 归入 io,但下载的文件未修改
解决办法:修改 HTMLTestRunner.py 文件
1.第94行:import StringIO ===> import io
2.第539行,self.outputBuffer = StringIO.StringIO() ===> self.outputBuffer = io.StringIO()
3.第631行,print >> sys.stderr, ‘\nTime Elapsed: %s’ % (self.stopTime-self.startTime) 去掉 >>
4.第642行,if not rmap.has_key(cls) ===> if not cls in rmap:
5.第766行,uo = o.decode(‘latin-1’) ===> uo = e
6.第772行,ue = e.decode(‘latin-1’) ===> ue = o
PyCharm 中跳转指定行:ctrl g 后输入 行号:1
解决参考:(7条消息) (五)Python3引用HTMLTestRunner报错“No module named ‘StringIO‘”,修改代码_贞子阿姨的博客-CSDN博客