selfteaching / selfteaching/selfteaching-python-camp
Day11 发送邮件时报错 UnicodeDecodeError
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 151
- Forks
- 875
- PR merge metrics
- No merged PRs in 30d
Description
一开始我以为是我写的程序有问题,后来尝试执行了前一期其他班同学的作业,发现返回的结果都是这个,我猜想是不是系统方面的问题,求大神帮忙解答。跪谢!
错误代码如下:
Traceback (most recent call last):
File "day11_training1.py", line 32, in <module>
yag.send(recipients,'19100205 ss412231878',wechat_word)
File "C:\Users\33\Anaconda3\lib\site-packages\yagmail\sender.py", line 144, in send
self.login()
File "C:\Users\33\Anaconda3\lib\site-packages\yagmail\sender.py", line 243, in login
self._login(self.credentials)
File "C:\Users\33\Anaconda3\lib\site-packages\yagmail\sender.py", line 189, in _login
self.smtp = self.connection(self.host, self.port, **self.kwargs)
File "C:\Users\33\Anaconda3\lib\smtplib.py", line 1031, in __init__
source_address)
File "C:\Users\33\Anaconda3\lib\smtplib.py", line 261, in __init__
fqdn = socket.getfqdn()
File "C:\Users\33\Anaconda3\lib\socket.py", line 676, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 2: invalid continuation byte
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with day11_training1.py and reproduce the traceback at yagmail.send, then inspect the Python smtplib and socket.getfqdn calls shown in the stack trace. Compare the failing environment with the other reported executions and document the confirmed cause and resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100