Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ID = None cause File id mismatch errors on first upload #66

Closed
GyroLand opened this issue May 16, 2014 · 15 comments · Fixed by #80
Closed

ID = None cause File id mismatch errors on first upload #66

GyroLand opened this issue May 16, 2014 · 15 comments · Fixed by #80

Comments

@GyroLand
Copy link

Hi!

When uploading new files to drive, the ID comes up as None (as defined by SyncFileLocal.getInfo, i guess) in the properties, and this causes a http 400 error saying File ID mismatch.
I could actually fix this by changing the create method in class _Drive like this:

for k, v in properties.iteritems():
            if v is not None:
                body[k] = _Drive.utf8(v)

I am just not sure that this won't cause any other problems. I am using the latest pip version, not the git one. But i think the same would happen in the git version as well.

@gabrewat
Copy link

Thanks for the fix, GyroLand. Worked well for me and now Google Drive syncing is functional.
I had to search a little bit for where you changed the source. For me, that was in the file "/usr/lib/python2.6/site-packages/libgsync/drive/init.py" at about line #644-646 (parsing might remove the double underscore characters preceding and following "init").

@orgnac
Copy link

orgnac commented Jun 14, 2014

This works for me too, but I don't understand the fix.

@ghost
Copy link

ghost commented Jun 22, 2014

Same problem here.
@GyroLand Kudos for the fix :)

@ingoha
Copy link

ingoha commented Aug 9, 2014

Worked for me +1

@keesverstoep
Copy link

Worked for me too, thanks!

@kgoderis
Copy link

+1

1 similar comment
@dgitman
Copy link

dgitman commented Sep 15, 2014

+1

@dmutters
Copy link

It looks like this method works well, except when it runs into a file that ends in a ~ character. Then, you get this:

Monsters/Lvl. 3 - Undead Horrid Housecat~
           0   0%     0.00B/s    0:00:00DEBUG: 'Exception':   File "/usr/local/lib/python2.7/dist-packages/libgsync/drive/__init__.py", line 712, in update
    status, res = req.next_chunk()
  File "/usr/local/lib/python2.7/dist-packages/oauth2client/util.py", line 132, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/apiclient/http.py", line 874, in next_chunk
    return self._process_response(resp, content)
  File "/usr/local/lib/python2.7/dist-packages/apiclient/http.py", line 901, in _process_response
    raise HttpError(resp, content, uri=self.uri)

I think it's just an escaping issue, but since I don't know python, I'm not sure how to fix it. Any ideas?

@p4r0d5
Copy link

p4r0d5 commented Nov 21, 2014

yeah! it works! thanks a lot GyroLand.

benfry added a commit to benfry/gsync that referenced this issue Dec 21, 2014
@sudsy
Copy link

sudsy commented Dec 31, 2014

@benfry Have you thought about a pull request to merge your fix into the main project? It would be great to have these issues resolved in the main project.

jeztucker added a commit to arcapix/gsync that referenced this issue Jan 6, 2015
@benfry
Copy link
Contributor

benfry commented Jan 16, 2015

@sudsy I hadn't yet—I wasn't able to confirm whether the changes were enough to give me a working repo, but it looks like @iwonbigbro has merged them since. Thanks!

@guillaumemorin
Copy link

I've just installed the 0.1.14 version with pip on Debian 7.7 and I had to make the fix too (in /usr/local/lib/python2.7/dist-packages/libgsync/drive/init.py). Works well now, thx @GyroLand ;)

@ramicio
Copy link

ramicio commented Mar 3, 2015

This doesn't work for me. First off, the --authentication flag doesn't do anything for me. It's not even listed under my help. Secondly, it doesn't upload anything. 0 bytes. I apply this "fix," and I just get errors:

Traceback (most recent call last):
File "/usr/local/bin/gsync", line 8, in
from libgsync.crawler import Crawler
File "/usr/local/lib/python2.7/dist-packages/libgsync/crawler.py", line 4, in
from libgsync.sync import Sync
File "/usr/local/lib/python2.7/dist-packages/libgsync/sync/init.py", line 5, in
from libgsync.drive.mimetypes import MimeTypes
File "/usr/local/lib/python2.7/dist-packages/libgsync/drive/init.py", line 646
body[k] = _Drive.utf8(v)
^
IndentationError: unindent does not match any outer indentation level

@arielscarpinelli
Copy link

@iwonbigbro Could you please release a new version including this fix? You merged the patch in Jan but seems that never released the update to pypi. Thanks!

@tevch
Copy link

tevch commented Feb 16, 2016

yes, please
i got the same issue, same fix
but please release it to pip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.