gmail python客户端api导入消息显示语法错误 [英] gmail python client api import message shows Syntax error
问题描述
gmail python api service.users().messages().import
显示语法错误,这是代码行
gmail python api service.users().messages().import
shows Syntax error here is line of code
mgg = services.users().messages().import(userId='me', raw=base64.urlsafe_b64encode(mime_msg.as_string()), labelIds=mime_msg.get('labelIds')).execute()
import(
如果我将import
更改为诸如importee
之类的内容,则显示此错误
AttributeError: 'Resource' object has no attribute 'importee'
看起来和它有关吗?
If I change import
to something such as importee
then it is showing this error
AttributeError: 'Resource' object has no attribute 'importee'
So looks like it is related to?
Python保留关键字
Python Reserved Keyword
我还提交了gmail api中的错误,此处是指向 Google问题跟踪器的链接 >
I have also submitted bug in gmail api here is link to google issue tracker
推荐答案
我发现 cdleary 发出的python#comment115219_77552>评论.解决方法是将_
附加到import
.
service.users().messages().import_()
正在工作.虽然我仍然在Google问题追踪器中有未解决的问题.
I found a comment by user cdleary that helped. Work-around is I appended _
to import
.
service.users().messages().import_()
is working. Though still I have issue open in Google issue tracker.
这篇关于gmail python客户端api导入消息显示语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!