carolinux / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
0 stars 1 forks source link

DocumentsList: deleting a file with delete=true #446

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
entry = docs_client.GetDoc(resource_id)
docs_client.delete(entry.GetEditLink().href + '?delete=true', force=True)

the ?delete=true parameter isn't being appended to the request URL, so the file 
is in the trash but not deleted.

What is the expected output? What do you see instead?
The file should be deleted, but instead is in the trash.

Original issue reported on code.google.com by jkleiner...@gmail.com on 16 Sep 2010 at 3:01

GoogleCodeExporter commented 9 years ago
If the edit link already has query parameters then doing 

  "+ '?delete=true' 

won't make it a valid uri. I.e it may look something like 

  http://example.com?foo=bar&baz=qux?delete=true

and later when the uri is passed to atom.http_core.Uri.parse_uri() the trailing 
?delete=true is probably stripped off. To be safe you should parse the uri, 
turn the query parameters into a dict, add your new parameter to the 
dictionary, then reconstitute the uri before passing it to delete().

Original comment by joe.gregorio@gmail.com on 17 Sep 2010 at 6:54

GoogleCodeExporter commented 9 years ago
This potential problem is still present in the latest version of the Documents 
List client.

Original comment by afs...@google.com on 19 Dec 2011 at 12:09