質問編集履歴

2

タグ

2022/09/13 14:27

投稿

HirokiTomimura
HirokiTomimura

スコア26

test CHANGED
File without changes
test CHANGED
File without changes

1

エラー

2022/09/13 09:09

投稿

HirokiTomimura
HirokiTomimura

スコア26

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 Traceback (most recent call last)
11
+ UnicodeEncodeError Traceback (most recent call last)
14
12
  <ipython-input-2-48e1f5c98f61> in <module>
15
- 30 filename = part.get_filename()
13
+ 30 filename = part.get_filename()
16
- 31 if not filename:
14
+ 31 if not filename:
17
- ---> 32 body = base64.urlsafe_b64decode(part.get_payload().encode('ASCII')).decode('utf-8')
15
+ ---> 32 body = base64.urlsafe_b64decode(part.get_payload().encode('ASCII')).decode('utf-8')
18
- 33 print(f"本文:{body}")
16
+ 33 print(f"本文:{body}")
19
- 34 else:
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