Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gdata spreadsheet library for python not working anymore?

I was trying to run a query for data in one of my google docs, and it's worked for several months. Starting yesterday or the day before, I noticed that my script no longer works. Has Google updated their api for spreadsheets? Has anybody found a workaround?

My error looks like this:

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

I am using:

  • Python 2.7.5
  • gdata 2.0.18

I am just using an document key and no oauth in my code, if that makes a difference (I am passing in the username and password to the ClientLogin method)

like image 254
ldanielw1 Avatar asked May 27 '15 20:05

ldanielw1


1 Answers

Actually here is the answer to the problem:

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.

After sending xml for update in spreadsheet google respond with a login page. It means the authentication is not working for gdata now

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

like image 176
Andrée B Avatar answered Nov 16 '22 00:11

Andrée B