gpt4 book ai didi

python - 有问题的文件名 - 是拉丁文吗?我如何将其转换为 ascii?

转载 作者:太空宇宙 更新时间:2023-11-04 10:50:14 25 4
gpt4 key购买 nike

<分区>

从 gmail 检索文件以保存它时,我收到以下错误消息:

Traceback (most recent call last):
File "C:\a.py", line 32, in on_hello
if getmail(self):
File "C:\a.py", line 96, in getmail
fp = open(att_path, 'wb')
IOError: [Errno 22] invalid mode ('wb') or filename: '.\\=?iso-8859-1?Q?CC_GM=5F
Est=E1vel.xlsx?='

现在,我怀疑 =?iso-8859-1?Q?CC_GM=5FEst=E1vel.xlsx?= 是问题所在,如何将其转换为 ansii?我尝试使用各种 .decode 和 .encode 组合,但没有成功。

谢谢

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