gpt4 book ai didi

python - python 的 gdata 电子表格库不再工作了?

转载 作者:太空狗 更新时间:2023-10-30 01:07:31 25 4
gpt4 key购买 nike

我试图在我的一个谷歌文档中运行数据查询,它已经工作了几个月。从昨天或前一天开始,我发现我的脚本不再有效。 Google 是否更新了电子表格的 API?有人找到解决方法了吗?

我的错误是这样的:

Traceback (most recent call last):
File "build_packer_image.py", line 311, in <module>
for index, entry in enumerate(client.GetWorksheetsFeed(doc_key).entry):
File "/build/toolchain/mac-10.5-32/lib/python2.7/site-packages/gdata/spreadsheet/service.py", line 129, in GetWorksheetsFeed
converter=gdata.spreadsheet.SpreadsheetsWorksheetsFeedFromString)
File "/build/toolchain/mac-10.5-32/lib/python2.7/site-packages/gdata/service.py", line 1074, in Get
return converter(result_body)
File "/build/toolchain/mac-10.5-32/lib/python2.7/site-packages/gdata/spreadsheet/__init__.py", line 411, in SpreadsheetsWorksheetsFeedFromString
xml_string)
File "/build/toolchain/mac-10.5-32/lib/python2.7/site-packages/atom/__init__.py", line 93, in optional_warn_function
return f(*args, **kwargs)
File "/build/toolchain/mac-10.5-32/lib/python2.7/site-packages/atom/__init__.py", line 127, in CreateClassFromXMLString
tree = ElementTree.fromstring(xml_string.replace('doctype','DOCTYPE'))
File "<string>", line 125, in XML
cElementTree.ParseError: no element found: line 1, column 0
Build step 'Execute shell' marked build as failure
Finished: FAILURE

我正在使用:

  • python 2.7.5
  • gdata 2.0.18

我只是在我的代码中使用了一个文档 key 而没有使用 oauth,如果这会有所不同(我将用户名和密码传递给 ClientLogin 方法)

最佳答案

其实这里就是问题的答案:

The use of client login (using username/password instead of oauth2) is likely the cause of the error. That protocol was deprecated 3+ years ago and was just shutdown. If you capture the HTTP response (which appears to have some HTML content), that might confirm if it is related to the shutdown. Migrating to OAuth 2 would get your apps working again.

在电子表格中发送用于更新的 xml 后,谷歌会返回一个登录页面。这意味着身份验证现在不适用于 gdata

https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3851#c2

关于python - python 的 gdata 电子表格库不再工作了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30492589/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com