質問編集履歴
2
タグ
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
エラー
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,17 +8,17 @@
|
|
8
8
|
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-7: ordinal not in range(128)
|
9
9
|
|
10
10
|
```
|
11
|
-
エラーメッセージ
|
12
|
-
```
|
13
|
-
UnicodeEncodeError
|
11
|
+
UnicodeEncodeError Traceback (most recent call last)
|
14
12
|
<ipython-input-2-48e1f5c98f61> in <module>
|
15
|
-
|
13
|
+
30 filename = part.get_filename()
|
16
|
-
|
14
|
+
31 if not filename:
|
17
|
-
---> 32
|
15
|
+
---> 32 body = base64.urlsafe_b64decode(part.get_payload().encode('ASCII')).decode('utf-8')
|
18
|
-
|
16
|
+
33 print(f"本文:{body}")
|
19
|
-
|
17
|
+
34 else:
|
20
18
|
|
21
19
|
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-7: ordinal not in range(128)
|
20
|
+
```
|
21
|
+
|
22
22
|
|
23
23
|
```python
|
24
24
|
import imaplib
|