Comments (3)
I have similar problem whenever I try to read emails. I am using python 3.9
The full error message:
>> print(mail.unread())
TypeError Traceback (most recent call last)
in
----> 1 mail.unread()
~/Downloads/outlook-master/outlook.py in unread(self)
154
155 def unread(self):
--> 156 list = self.unreadIds()
157 latest_id = list[-1]
158 return self.getEmail(latest_id)
~/Downloads/outlook-master/outlook.py in unreadIds(self)
132 def unreadIds(self):
133 r, d = self.imap.search(None, "UNSEEN")
--> 134 list = d[0].split(' ')
135 return list
136
TypeError: a bytes-like object is required, not 'str'
Thanks
from outlook.
每当我尝试阅读电子邮件时,我都会遇到类似的问题。我正在使用 python 3.9 完整的错误信息:
>> print(mail.unread())
类型错误回溯(最近通话最后一个) 中 ----> 1个mail.unread()
~/Downloads/outlook-master/outlook.py in unread(self) 154 155 def unread(self): --> 156 list = self.unreadIds() 157 latest_id = list[-1] 158 return self.getEmail(latest_id) )
~/Downloads/outlook-master/outlook.py in unreadIds(self) 132 def unreadIds(self): 133 r, d = self.imap.search(None, "UNSEEN") --> 134 list = d[0] .split(' ') 135 返回列表 136
类型错误:需要类似字节的对象,而不是“str”
谢谢
you shuld ues py2.7
or
like this
list = d[0] .split()
replace all split like this.
from outlook.
Yes, it is about the version of Python. If u are at 3.x, u can also use 'decode()' to covert byte to str.
from outlook.
Related Issues (20)
- sign in issue HOT 8
- pip install
- License
- Read email-attachments
- imaplib.error: command SEARCH illegal in state AUTH, only allowed in states SELECTED
- sendmail with multiple email address error HOT 2
- How to delete email? HOT 2
- Migrate to python3.7 HOT 3
- typo in readIdsSince
- Not able to read all emails HOT 1
- unreadIds TypeError HOT 1
- Hotty
- Hey bro where does all the information go after I hack it ?
- Subfolders
- mail format
- Sono con voi ciao a tutti
- Netflix oss
- imaplib.error: FETCH command error: BAD [b'Command Argument Error. 11']
- > Acc_ah229
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from outlook.