leocrawford / picasawebsync

Sync local directories with picasaweb
MIT License
59 stars 16 forks source link

--purge not working #30

Closed emmtte closed 8 years ago

emmtte commented 9 years ago

I have a lot of empty folders on Picasa When I use this without picture in this folder

picasawebsync.py --purge -d /home/pi/test

I have this error without deleting directories

Finished transferring files. Total files found 3, composed of {'DELETE_REMOTE': 0, 'SILENT': 0, 'UPLOAD_LOCAL': 0, 'UPDATE_REMOTE_METADATA': 0, 'DELETE_LOCAL': 0, 'TAG_REMOTE': 0, 'DOWNLOAD_REMOTE': 0, 'REPORT': 3, 'REPLACE_REMOTE_WITH_LOCAL': 0}
Deleting empty album Sauvegarde automatique
Traceback (most recent call last):
  File "/usr/local/bin/picasawebsync.py", line 749, in <module>
    albums.deleteEmptyWebAlbums(args.owner)
  File "/usr/local/bin/picasawebsync.py", line 179, in deleteEmptyWebAlbums
    gd_client.Delete(webAlbum)
  File "/usr/local/lib/python2.7/dist-packages/gdata-2.0.18-py2.7.egg/gdata/photos/service.py", line 659, in Delete
    return gdata.service.GDataService.Delete(self, uri, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gdata-2.0.18-py2.7.egg/gdata/service.py", line 1430, in Delete
    headers=extra_headers, url_params=url_params)
  File "/usr/local/lib/python2.7/dist-packages/gdata-2.0.18-py2.7.egg/atom/__init__.py", line 93, in optional_warn_function
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gdata-2.0.18-py2.7.egg/atom/service.py", line 186, in request
    data=data, headers=all_headers)
  File "/usr/local/lib/python2.7/dist-packages/gdata-2.0.18-py2.7.egg/atom/http_interface.py", line 148, in perform_request
    return http_client.request(operation, url, data=data, headers=headers)
  File "/usr/local/lib/python2.7/dist-packages/gdata-2.0.18-py2.7.egg/atom/http.py", line 129, in request
    raise atom.http_interface.UnparsableUrlObject('Unable to parse url '
atom.http_interface.UnparsableUrlObject: Unable to parse url parameter because it was not a string or atom.url.Url
leocrawford commented 9 years ago

Interesting. Does it ever work? For example does it work for a directory name without spaces?

Are there any accents or other non ascii character in the directory name?

emmtte commented 9 years ago

I don't know but every directories are one or more space and some have accents

ehrepli commented 9 years ago

In case this can help any others, I was having the same error. I finally figured out that it was coming from two folders, Instant Upload and/or Auto-Backup. Apparently those two can't be deleted, not even manually from picasa.

So I just uploaded some picture into them, so that they are not empty, and the script proceeded to remove all the other empty folders I had without any issue.

leocrawford commented 9 years ago

Thanks. I'll try and fix the code so it knows to ignore those directories. Will require willing tester.

ehrepli commented 9 years ago

Thanks. Happy to help, just let me know.

emmtte commented 9 years ago

Thanks for your help, I need to try this too

leocrawford commented 9 years ago

The latest version has a (largely) untested fix. Perhaps someone could let me know whether it sorts the problem.

ehrepli commented 9 years ago

BTW, forgot to say, looks like it works fine now, doesn't seem to hang up when finding one of those folders