gpt4 book ai didi

python - Unicode解码错误: 'utf8' codec can't decode byte 0xb4 in position 98: invalid start byte

转载 作者:太空宇宙 更新时间:2023-11-03 18:48:03 25 4
gpt4 key购买 nike

我正在运行https://github.com/tianyu0915/pythoner.net/在我的 MacBookPro 上学习 django。

按照自述文件所述完成后,当我运行应用程序时,控制台显示:

Traceback (most recent call last):  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run    self.result = application(self.environ, self.start_response)  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 67, in __call__    return self.application(environ, start_response)  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 241, in __call__    response = self.get_response(request)  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/core/handlers/base.py", line 179, in get_response    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception    return callback(request, **param_dict)  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view    response = view_func(request, *args, **kwargs)  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/views/defaults.py", line 32, in server_error    t = loader.get_template(template_name) # You need to create a 500.html template.  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/template/loader.py", line 145, in get_template    template, origin = find_template(template_name)  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/template/loader.py", line 134, in find_template    source, display_name = loader(name, dirs)  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/template/loader.py", line 42, in __call__    return self.load_template(template_name, template_dirs)  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/template/loader.py", line 45, in load_template    source, display_name = self.load_template_source(template_name, template_dirs)  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/site-packages/django/template/loaders/filesystem.py", line 39, in load_template_source    return (file.read().decode(settings.FILE_CHARSET), filepath)  File "/Users/keviswang/.virtualenvs/pythoner/lib/python2.7/encodings/utf_8.py", line 16, in decode    return codecs.utf_8_decode(input, errors, True)UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in position 98: invalid start byte

最佳答案

问题可能是this template file 。它不是 utf-8(似乎是 GB2312),但模板引擎尝试对其进行解码,因此导致错误。

将其转换为 utf-8,你应该会很好 - 至少对于问题的这一部分来说。下一步是首先找出导致服务器错误的原因。

也许您还应该在 github 上提交错误报告。

关于python - Unicode解码错误: 'utf8' codec can't decode byte 0xb4 in position 98: invalid start byte,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19030556/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com