carolinux / gdata-python-client

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

302 redirect fix #491

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. call a gdata service, like CalendarService
2. notice that gdata.service.GDataService trys to fetch the feed more than 4 
times
3.raise an error ("Redirect received, but redirects_remaining <= 0")

What is the expected output? What do you see instead?
you'd expect the service to fetch the feed in fewer than 4 times

What version of the product are you using?
current python gdata client (as of 1/31/11)

Please provide any additional information below.
this is sporadic.  it occurs when the feed returns a session id with a "-" more 
than 4 times.  which happens frequently for me.  this is because the regex on 
the session tester:

m = re.compile('[\?\&]gsessionid=(\w*)').search(location)

doesn't account for the presence of a "-", and should look like this instead:

m = re.compile('[\?\&]gsessionid=([\w\-]*)').search(location)

this occurs in three places in gdata/service.py.

(props to vintozver for the find)
http://www.google.com/support/forum/p/apps-apis/thread?tid=4a910698549aa1d6

Original issue reported on code.google.com by martinfc...@gmail.com on 31 Jan 2011 at 10:41

GoogleCodeExporter commented 9 years ago
The patch here !

Original comment by hubscher.remy on 18 Mar 2011 at 8:16

Attachments:

GoogleCodeExporter commented 9 years ago
Just in case anyone else stumbles on this - 

The release notes for gdata 2.0.14 claim that issue 491 was fixed in that 
release.  However, the "fix" in 2.0.14 is incorrect (and does not match the 
patch above, which is the correct one).

2.0.14 changes the regex to this:
m = re.compile('[\?\&]gsessionid=(\w*\-)').search(location)

This fails as for:
gsessionid=IUvz-U-0prLdALjDV0xhiQ

as the match returns "IUvz-" instead of the whole gsessionid.

Anyway, so you still need to manually apply the patch listed above to 2.0.14 to 
get things working properly.

Original comment by henne...@gmail.com on 21 Jun 2011 at 2:52

GoogleCodeExporter commented 9 years ago
Hello,

Please sync your client library with the project repository as fixes are pushed 
to the repository before making it to a release.
http://code.google.com/p/gdata-python-client/source/checkout

There is fix for this issue in the repository and it doesn't rely on a regex as 
the gsessionid may have a new pattern in the future.

Also, please use the "client/data" modules instead of the "service" modules as 
those have been deprecated and won't be supported any more.

Best,
Alain

Original comment by ala...@google.com on 21 Jun 2011 at 3:35