Thursday, February 2, 2012

GoogleCL Docs Upload Fixed for Gdata 2.0.15 and 2.0.16

Months ago, we fixed Google Docs Uploads for GoogleCL folks who use python-gdata 2.0.12 through 2.0.14. Today, we tackled the problem for users of python-gdata 2.0.15 and 2.0.16.

A user sent in a patch that fixed the MIMETYPES error we were getting with 2.0.15 and 2.0.16. It looks like python-gdata moved away from declaring MIMETYPES where we were calling them from, so now we name them explicitly in googlecl/src/googlecl/docs/

That was a great start, but then we started getting a DocsEntry error and uploads still wouldn't work, so we delved further. Here's the error we got after fixing the MIMETYPES problem.
AttributeError: 'module' object has no attribute 'DocsEntry'

One of our earlier searches brought us to the same error posted on python-gdata's buglist.

Then, we found this blog post, by Demon Lord, where they had success replacing the string "" with the string "". We tried that throughout the file googlecl/src/googlecl/docs/ and sure enough, that fixed it!

We tested 2.0.0 through 2.0.4 to make sure that didn't break anything for those users and then tested 2.0.12 through 2.0.16 to make sure it worked on all the versions that should be able to upload docs. It does so it's now been committed.

1 comment:

  1. Actually, the fix still isn't working:

    mandriver@mandriver-laptop:/tmp/googlecl-read-only$ /usr/local/bin/google docs list
    Traceback (most recent call last):
    File "/usr/local/bin/google", line 5, in
    pkg_resources.run_script('googlecl==0.9.13', 'google')
    File "/usr/lib/python2.7/dist-packages/", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
    File "/usr/lib/python2.7/dist-packages/", line 1235, in run_script
    execfile(script_filename, namespace, namespace)
    File "/usr/local/lib/python2.7/dist-packages/googlecl-0.9.13-py2.7.egg/EGG-INFO/scripts/google", line 989, in
    File "/usr/local/lib/python2.7/dist-packages/googlecl-0.9.13-py2.7.egg/EGG-INFO/scripts/google", line 975, in main
    run_once(options, args)
    File "/usr/local/lib/python2.7/dist-packages/googlecl-0.9.13-py2.7.egg/EGG-INFO/scripts/google", line 769, in run_once
    raise run_error
    AttributeError: 'module' object has no attribute 'DOCLIST_FEED_URI'

    This particular error can be fixed by replacing "" with "self.DOCLIST_FEED_URI" in docs/, but there're also other errors.

    I can reproduce with the latest SVN snapshot of googlecl and python-gdata 2.0.17 from Debian. By the way, this bug blocks release of Debian wheezy (

    Can you please fix the remaining issues?