google-code-export / gdata-python-client

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

many "HTTP 302" errors when deleting events on google calendar #570

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Delete a list of events on google calendar using the command line "google 
calendar delete -v --debug -q * --date=1/1/2011,2/31/2011 --yes"
2. You will delete a few events (~5)
3. Then get so many "HTTP 302" redirects ( check the below )

What is the expected output? What do you see instead?
Expected: deletion of events
What I see instead: check the below
send: 'DELETE 
http://www.google.com/calendar/feeds/j34m2rmse02pekt9fe97tqv1r4%40group.calendar
.google.com/private/full/_68o32c9g64o32ffffffffffffffffffi/63000000048?gsessioni
d=Vh95EFuB8KiDjA- HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: 
www.google.com\r\nContent-Type: application/atom+xml\r\nAuthorization: OAuth 
realm="", oauth_nonce="00000000", oauth_timestamp="1111111111", 
oauth_consumer_key="anonymous", oauth_signature_method="HMAC-SHA1", oa
uth_version="1.0", 
oauth_token="1%2FWbbeR1111111111111btq_epj111111111111111JT8", 
oauth_signature="nYstT1111111111111111111118%3D"\r\nUser-Agent: Goog
leCL GData-Python/2.0.15\r\n\r\n'
reply: 'HTTP/1.1 302 Moved Temporarily\r\n'
header: Expires: Wed, 07 Dec 2011 04:49:22 GMT
header: Date: Wed, 07 Dec 2011 04:49:22 GMT
header: Set-Cookie: S=calendar=H_czQnAzSzw2_R2sSdiRrg;Expires=Thu, 06-Dec-2012 
04:49:22 GMT
header: Location: 
http://www.google.com/calendar/feeds/j34mfffffffffffffe97tqv1r4%40group.calendar
.google.com/private/full/_68ffffffffffffffelk6usige9gnipbi/6345887ff8?gsessionid
=H_czQnAzSzw2_R2sSdiRrg
header: Content-Type: text/html; charset=UTF-8
header: Cache-Control: private, max-age=0
header: X-Content-Type-Options: nosniff
header: X-Frame-Options: SAMEORIGIN
header: X-XSS-Protection: 1; mode=block
header: Server: GSE
header: Transfer-Encoding: chunked

What version of the product are you using?
2.0.15

Please provide any additional information below.
I was able to solve it by changing the RE in gdata/service.py (line 1439)
  m = re.compile('[\?\&]gsessionid=(\w*\-)').search(location)
to 
  m = re.compile('[\?\&]gsessionid=(.*)&?').search(location)

This RE is repeated several times in service.py and they must be problematic 
too although I have not tested them.

Original issue reported on code.google.com by alrashedf@gmail.com on 7 Dec 2011 at 5:24

GoogleCodeExporter commented 9 years ago
Hello,

You should not use gdata.calendar.service.py but gdata.calendar.client.py as 
indicated by the Developers Guide:
  http://code.google.com/apis/calendar/data/2.0/developers_guide_python.html

Additionally, v1 (which you are using) and v2 of the Calendar API are being 
deprecated in favor of the new Calendar API v3:
  http://code.google.com/apis/calendar/v3/using.html

Best,
Alain

Original comment by ala...@google.com on 7 Dec 2011 at 4:30

GoogleCodeExporter commented 9 years ago
This documentation seems to have been changed in March 2011 (20049963) and I'm 
not sure how any of us were to know that gdata.calendar.service had been 
deprecated in favor of gdata.calendar.client. Previously the documentation 
stated to use gdata.calendar.service and used that in all the examples. We had 
working code that just all of a sudden stopped working :(

FYI this just broke Chrome team with no warning.

Original comment by ife...@google.com on 29 Feb 2012 at 6:11