编码问题
jhdxr opened this issue · comments
Describe the bug
--- Logging error ---
Traceback (most recent call last):
File "logging_init_.py", line 1036, in emit
UnicodeEncodeError: 'gbk' codec can't encode character '\u2665' in position 89: illegal multibyte sequence
Call stack:
File "manage.py", line 116, in
File "site-packages\flask_script_init_.py", line 417, in run
File "site-packages\flask_script_init_.py", line 386, in handle
File "site-packages\flask_script\commands.py", line 216, in call
File "manage.py", line 41, in fetch
File "fetch.py", line 87, in fetch_user
File "fetch.py", line 52, in fetch_status
File "crawl\status.py", line 53, in get_status
File "crawl\status.py", line 41, in load_status_page
File "crawl\utils.py", line 149, in get_likes
File "crawl\utils.py", line 48, in save_user
File "logging_init_.py", line 1371, in debug
File "logging_init_.py", line 1519, in log
File "logging_init.py", line 1529, in handle
File "logging_init_.py", line 1591, in callHandlers
File "logging_init_.py", line 905, in handle
File "logging\handlers.py", line 479, in emit
File "logging_init_.py", line 1132, in emit
File "logging_init_.py", line 1040, in emit
Message: 'try to save masked with headPic masked'
Arguments: ()
get image masked to local
To Reproduce
Steps to reproduce the behavior:
save any info from people whose name contains speical character, such as ♥
@jhdxr 请补充你的使用环境,OS 类型、版本、语言,命令行的类型,Python 版本
如果是在 Linux/macOS 下不应该有 gbk 的编码,如果是 Windows,考虑使用 PowerShell 或 WSL,或者直接使用发布的 .exe 运行
OS: win10 x64 1909
用的是release里的那个集成的。是在cmder(内置的应该也是conemu)里
我过会试试powershell
我确认powershell有同样的问题。
系统语音的话,我之前是英文(安装的时候应该是英文),但最近一个版本更新完后自己变中文了。。。我也没改回去。。。
如果你有 WSL 的话,推荐在 WSL 下直接运行 Python 源码版本的吧(我看你有用 cmder,猜测你会有 *nix 环境)
Windows 命令行的编码问题之前没有去太多关注,现在也没有太多空余时间去 debug
确认修复了,多谢