Python - 'ascii' codec can't decode byte

前端 未结 7 619
旧巷少年郎
旧巷少年郎 2021-01-30 17:08

I\'m using Python 2.6 and Jinja2 to create HTML reports. I provide the template with many results and the template loops through them and creates HTML tables

When callin

7条回答
  •  感情败类
    2021-01-30 17:23

    Try to add this:

    import sys
    reload(sys)
    sys.setdefaultencoding('utf-8')
    

    It fixed my problem, good luck.

提交回复
热议问题