Python Web.py模块错误【UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte....】

根据提示找到python3安装目录下的libs/site-pageages/web文件夹下template.py文件找到修改如下:

return Template(open(path).read(), filename=path, **self._keywords)

修改为

return Template(open(path,encoding='utf-8').read(), filename=path, **self._keywords)

找到libs/site-pageages/web文件夹下debugerror.py文件找到246行修改如下:

            source = open(filename).readlines()

修改为

            source = open(filename, encoding='utf-8').readlines()

posted @ 2023-01-30 10:12  爱知菜  阅读(39)  评论(0编辑  收藏  举报