Giter Club home page Giter Club logo

Comments (3)

AzizAlqasem avatar AzizAlqasem commented on May 30, 2024

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.

shuishen49 avatar shuishen49 commented on May 30, 2024

每当我尝试阅读电子邮件时,我都会遇到类似的问题。我正在使用 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.

HerronYang avatar HerronYang commented on May 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.