pythongdataelementtreegoogle-booksgdata-python-client

SyntaxError using gdata-python-client to access Google Book Search Data API


>>> import gdata.books.service
>>> service = gdata.books.service.BookService()
>>> results = service.search_by_keyword(isbn='0434003484')
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
  results = service.search_by_keyword(isbn='0434003484')
... snip ...
File "C:\Python26\lib\site-packages\atom\__init__.py", line 127, in CreateClassFromXMLString
  tree = ElementTree.fromstring(xml_string)
File "<string>", line 85, in XML
SyntaxError: syntax error: line 1, column 0

This is a minimal example -- in particular, the book service unit tests included in the package also fail with the exact same error. I've looked at the wiki and open issue tickets on Google Code to no avail (and this seems to me more apt to be a silly error on my end rather than a problem with the library). I'm not sure how to interpret the error message. If it matters, I'm using python 2.6.5 and the latest version of gdata, namely 2.0.10.


Solution

  • I found I needed to disable SSL in the gdata client for it to work:

    ...
    gd_client.ProgrammaticLogin()
    gd_client.ssl = False
    ...