try:
    suit = self.set_case_suite()
    if suit is not None:
        logger.info("********TEST START********")
        fp = open(resultPath, 'wb')
        runner = HTMLTestRunner.HTMLTestRunner(stream=fp, title='Test Report', description='Test Description')
        runner.run(suit)
    else:
        logger.info("Have no case to test.")
except Exception as ex:
    logger.error(str(ex))

运行到 runner.run(suit) 时抛异常"a bytes-like object is required, not 'str'"
同样的代码在别人的机子上可以运行成功
都是 Python3.6,是我的环境有问题吗,找不到原因,有同学知道的可以指导一下吗,急


↙↙↙阅读原文可查看相关链接,并与作者交流