salimoha / googlecl

Automatically exported from code.google.com/p/googlecl
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 <module>
    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 <module>

  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 <module>
    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 <module>

  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><html 
lang="en"><head><meta name="description" content="Web word processing, 
presentations and spreadsheets"><link rel="shortcut icon" 
href="https://ssl.gstatic.com/docs/documents/images/kix-favicon.ico"><title>Goog
le Docs -- Page Not Found</title><style 
type="text/css">#gbar,#guser{font-size:13px;padding-right:8px;padding-top:4px 
!important}#gbar{padding-left:8px;height:22px}#guser{padding-bottom:7px 
!important;text-align:right}.gbh,.gbd{border-top:1px solid 
#c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media

all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb
1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf 
.gb4{color:#900 !important}</style><style type="text/css">body 
{background-color: #fff; font-family: Arial,sans-serif; font-size: 12px; 
margin: 0; padding: 0;}a, a: link, a: visited {color: #112ABB;}.footerCell 
{border-top: 1px solid #ccc; color: #666; padding-top: 4px;}</style><style 
type="text/css">.errorMessage {font-size: 12pt; font-weight: bold; line-height: 
150%; padding-bottom: 15px; padding-top: 25px;}</style></head><body><div 
id=gbar><nobr><a target=_blank href="http://mail.google.com/mail/?tab=om" 
class=gb1>Gmail</a> <a target=_blank 
href="http://www.google.com/calendar/render?tab=oc" class=gb1>Calendar</a> <b 
class=gb1>Documents</b> <a target=_blank 
href="http://www.google.com/webhp?tab=ow" class=gb1>Web</a> <a target=_blank 
href="http://www.google.com/reader/?tab=oy" class=gb1>Reader</a> <a 
href="http://www.google.com/intl/en/options/" class=gb1 
style="text-decoration:none"><u>more</u> &raquo;</a></nobr></div><div id=guser 
width=100%><nobr><span id=gbn class=gbi></span><span id=gbf class=gbf><b><a 
target=\'_blank\' 
href="https://docs.google.com/support/bin/answer.py?answer=176442" 
class=gb4>New version</a></b> | </span><b class=gb4>MY_ACCOUNT@gmail.com</b> | 
<span id=gbe></span><a target=\'_blank\' 
href="https://docs.google.com/settings" class=gb4>Settings</a> | <a 
href="/logout" class=gb4>Sign out</a></nobr></div><div class=gbh 
style=left:0></div><div class=gbh style=right:0></div><div 
style="clear:both"></div><div style="padding: 8px;"><a 
href="//docs.google.com/"><img id="docs-logo" 
src="//docs.google.com/images/docs_logo.gif"width="122"border="0" 
alt=""></a></div><center><table><tr><td><div align="center"><p 
class="errorMessage" style="padding-top: 50px">Sorry, the page (or document) 
you have requested does not exist.</p><p>Please check the address and try 
again.</p><div style="background: #F0F6FF; border: 1px solid black; margin-top: 
35px; padding: 10px 125px; width: 300px;"><p><strong>Want to create your own 
online docs?</strong></p><p>Google Docs makes it easy to create, store and 
share online documents, spreadsheets and presentations.</p><p>Learn more at <a 
href="https://docs.google.com">docs.google.com</a>.</p></div></div></td></tr></t
able></center><div align="center" style="padding-top: 60px"><table 
cellpadding="0" cellspacing="0" width="100%"><tr><td class="footerCell" 
align="center"><table cellpadding="0" cellspacing="0" border="0"><tr><td 
style="color:#666">&copy;2008 Google&nbsp;</td><td>-&nbsp;</td><td><a 
href="http://docs.google.com/support/?hl=en" target="_blank">Google Docs 
Help</a>&nbsp;</td><td>-&nbsp;</td><td><a 
href="http://www.google.com/accounts/TOS" target="_blank">Terms of 
Use</a>&nbsp;</td><td>-&nbsp;</td><td><a 
href="http://www.google.com/google-d-s/intl/en/privacy.html" 
target="_blank">Privacy Policy</a>&nbsp;</td><td>-&nbsp;</td><td><a 
href="http://www.google.com/google-d-s/intl/en/legal.html" 
target="_blank">Copyright 
Notices</a>&nbsp;</td></tr></table></td></tr></table></div></body></html>', 
'reason': 'Not Found'}

versions:

Mac OS 10.6.4 
Python 2.6.1
gdata-2.0.10
googlecl-0.9.8

Original issue reported on code.google.com by step...@gmail.com on 30 Jun 2010 at 10:57

GoogleCodeExporter commented 9 years ago
gentoo 10.0 kernel 2.6.32-r7
python 2.6.5-r2
gdata 2.0.9
googlecl 0.9.7-r1

Original comment by johnson....@gmail.com on 1 Jul 2010 at 12:35

GoogleCodeExporter commented 9 years ago
Same here:

Arch Linux

python 2.6.5
gdata 2.0.10
googlecl 0.9.8

Original comment by icarnales on 5 Jul 2010 at 2:42

GoogleCodeExporter commented 9 years ago
I have the same issue:

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

Original comment by mjeli...@gmail.com on 5 Jul 2010 at 8:02

GoogleCodeExporter commented 9 years ago
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?

Original comment by tom.h.mi...@gmail.com on 9 Jul 2010 at 11:04

Attachments:

GoogleCodeExporter commented 9 years ago
I'm using vim, the document is simple text.

Original comment by step...@gmail.com on 9 Jul 2010 at 2:22

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

Original comment by ichth...@gmail.com on 9 Jul 2010 at 2:35

GoogleCodeExporter commented 9 years ago
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?

Original comment by tom.h.mi...@gmail.com on 9 Jul 2010 at 3:50

GoogleCodeExporter commented 9 years ago
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.

Original comment by mjeli...@gmail.com on 9 Jul 2010 at 4:43

GoogleCodeExporter commented 9 years ago
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.

Original comment by tom.h.mi...@gmail.com on 9 Jul 2010 at 11:11

GoogleCodeExporter commented 9 years ago
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.

Original comment by johnson....@gmail.com on 10 Jul 2010 at 2:28

GoogleCodeExporter commented 9 years ago
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!

Original comment by mjeli...@gmail.com on 11 Jul 2010 at 12:56

GoogleCodeExporter commented 9 years ago
r337 fixes this issue.

Thanks for reporting in, everyone!

Original comment by tom.h.mi...@gmail.com on 12 Jul 2010 at 7:15

GoogleCodeExporter commented 9 years ago
Issue 202 has been merged into this issue.

Original comment by tom.h.mi...@gmail.com on 12 Jul 2010 at 9:44