vinitkumar / googlecl

GoogleCL rewrite in __progress__
Other
325 stars 48 forks source link

Unable to save after editing existing documents, unable to create new documents #207

Closed vinitkumar closed 10 years ago

vinitkumar commented 10 years ago

From step...@gmail.com on July 01, 2010 04:27:03

When I edit a doc, it opens fine in vim, but when I quit vim (:wq), I get an error:

Traceback (most recent call last): File "/usr/local/bin/google", line 5, in pkg_resources.run_script('googlecl==0.9.8', 'google') File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 442, in run_script self.require(requires)[0].run_script(script_name, ns) File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 1167, in run_script exec script_code in namespace, namespace File "/Library/Python/2.6/site-packages/googlecl-0.9.8-py2.6.egg/EGG-INFO/scripts/google", line 536, in

File "/Library/Python/2.6/site-packages/googlecl-0.9.8-py2.6.egg/EGG-INFO/scripts/google", line 530, in main

File "/Library/Python/2.6/site-packages/googlecl-0.9.8-py2.6.egg/EGG-INFO/scripts/google", line 408, in run_once

File "build/bdist.macosx-10.6-universal/egg/googlecl/docs/service.py", line 555, in _run_edit File "build/bdist.macosx-10.6-universal/egg/googlecl/docs/service.py", line 134, in edit_doc File "/Library/Python/2.6/site-packages/gdata/service.py", line 1398, in Put media_source=media_source, converter=converter) File "/Library/Python/2.6/site-packages/gdata/service.py", line 1361, in PostOrPut 'reason': server_response.reason, 'body': result_body} gdata.service.RequestError: {'status': 400, 'body': 'Could not convert document.', 'reason': 'Bad Request'}

And if I edit a document that doesn't exist, it creates it on the server fine, but it won't open, though it is empty and exists if I check through the web browser. Error:

No matching documents found! Creating it. Traceback (most recent call last): File "/usr/local/bin/google", line 5, in pkg_resources.run_script('googlecl==0.9.8', 'google') File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 442, in run_script self.require(requires)[0].run_script(script_name, ns) File "/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py", line 1167, in run_script exec script_code in namespace, namespace File "/Library/Python/2.6/site-packages/googlecl-0.9.8-py2.6.egg/EGG-INFO/scripts/google", line 536, in

File "/Library/Python/2.6/site-packages/googlecl-0.9.8-py2.6.egg/EGG-INFO/scripts/google", line 530, in main

File "/Library/Python/2.6/site-packages/googlecl-0.9.8-py2.6.egg/EGG-INFO/scripts/google", line 408, in run_once

File "build/bdist.macosx-10.6-universal/egg/googlecl/docs/service.py", line 555, in _run_edit File "build/bdist.macosx-10.6-universal/egg/googlecl/docs/service.py", line 117, in edit_doc File "/Library/Python/2.6/site-packages/gdata/docs/service.py", line 361, in Export self.Download(entry_or_id_or_url, file_path, ext, gid, extra_params) File "/Library/Python/2.6/site-packages/gdata/docs/service.py", line 340, in Download self._DownloadFile(url, file_path) File "/Library/Python/2.6/site-packages/gdata/docs/service.py", line 178, in _DownloadFile 'body': response_body} gdata.service.RequestError: {'status': 404, 'body': '<!DOCTYPE html>Google Docs -- Page Not Found

<a target=\'_blank\' href=" https://docs.google.com/support/bin/answer.py?answer=176442 " class=gb4>New version | MY_ACCOUNT@gmail.com | <a target=\'_blank\' href=" https://docs.google.com/settings " class=gb4>Settings | Sign out

Sorry, the page (or document) you have requested does not exist.

Please check the address and try again.

Want to create your own online docs?

Google Docs makes it easy to create, store and share online documents, spreadsheets and presentations.

Learn more at docs.google.com.

©2008 Google Google Docs Help Terms of Use Privacy Policy Copyright Notices 
...

Original issue: http://code.google.com/p/googlecl/issues/detail?id=199

vinitkumar commented 10 years ago

From johnson....@gmail.com on June 30, 2010 17:35:43

gentoo 10.0 kernel 2.6.32- r7 python 2.6.5- r2 gdata 2.0.9 googlecl 0.9.7- r1

vinitkumar commented 10 years ago

From icarnales on July 05, 2010 07:42:46

Same here:

Arch Linux

python 2.6.5 gdata 2.0.10 googlecl 0.9.8

vinitkumar commented 10 years ago

From mjeli...@gmail.com on July 05, 2010 13:02:07

I have the same issue:

Red Hat Enterprise Linux v5.5 Python 2.7rc2 gdata 2.0.10 googlecl 0.9.8

vinitkumar commented 10 years ago

From tom.h.mi...@gmail.com on July 09, 2010 04:04:08

I haven't been able to reproduce those exact errors, but the attached patch (against 0.9.8) may help, especially with the second error.

For the first, the bad request -- what editor are you using, what type of document are you editing, and what format are you downloading it as?

Attachment: edit_docs.patch

vinitkumar commented 10 years ago

From step...@gmail.com on July 09, 2010 07:22:32

I'm using vim, the document is simple text.

vinitkumar commented 10 years ago

From ichth...@gmail.com on July 09, 2010 07:35:10

Patch fixes document creation for me, but I'd really like to edit my existing docs again. :)

vinitkumar commented 10 years ago

From tom.h.mi...@gmail.com on July 09, 2010 08:50:08

Well, I've been able to reproduce the "Could not convert" error, but only when doing something weird like editing a spreadsheet with vim.

The problem is that when the document gets uploaded after editing, the content type disagrees with what Docs expects. I'm not sure how to figure out what Docs expects.

This (or something like it) has been reported at http://code.google.com/p/gdata-issues/issues/detail?id=1480 , and someone claims a fix for html files is being pushed as soon as possible. So anyone still having issues may want to check out that issue from time to time and update to the most recent version.

icthyos: Out of curiosity, can you edit an existing doc that was created through the patched document creation?

Everyone: Does the "Could not convert" error occur with every file of the same type, or just one or two?

Status: Accepted

vinitkumar commented 10 years ago

From mjeli...@gmail.com on July 09, 2010 09:43:22

I get the error for every file I have tried. And they are simple text files which were originally created via the Google Docs web interface. And this still holds true even after applying the patch--which you probably expected.

vinitkumar commented 10 years ago

From tom.h.mi...@gmail.com on July 09, 2010 16:11:13

I'm guessing the first problem (Could not convert...) lies with the new-version documents that Google recently rolled out.

Could everyone try the most recent version in the trunk? It should catch this problem and direct you to the FAQ which tells you how to convert to old-style docs.

It seems that all new-version documents have a grey margin around the actual document editing space. If you're getting the could not convert error with old-style docs, let me know.

vinitkumar commented 10 years ago

From johnson....@gmail.com on July 09, 2010 19:28:05

The most recent version from trunk works for me with the new version documents.

I crafted an svn ebuild in my local portage overlay (googlecl-9999) and installed googlecl. It worked great.

python-2.6.5- r2 gdata-2.0.9 googlecl - from svn trunk - revision 339 And, yes, older documents do indeed get caught and did direct me to the FAQ:

{'status': 400, 'body': 'Could not convert document.', 'reason': 'Bad Request'} Is this a new-version document? gdata has a bug preventing updates on new version documents. Please follow the instructions on the FAQ in the wiki on how to convert your document.

vinitkumar commented 10 years ago

From mjeli...@gmail.com on July 10, 2010 17:56:43

I updated to the trunk and changed my Google docs settings not to use the latest Google doc format and I can now successfully edit my google docs again.

Thanks for the support!

vinitkumar commented 10 years ago

From tom.h.mi...@gmail.com on July 12, 2010 12:15:56

r337 fixes this issue.

Thanks for reporting in, everyone!

Status: Fixed

vinitkumar commented 10 years ago

From tom.h.mi...@gmail.com on July 12, 2010 14:44:17

Issue 202 has been merged into this issue.