Issue 693 in gdata-python-client: Can't access contact information anymore

50 views
Skip to first unread message

gdata-pyt...@googlecode.com

unread,
Apr 3, 2014, 7:58:19 AM4/3/14
to gdata-python-client-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 693 by jpsch...@gmail.com: Can't access contact information
anymore
http://code.google.com/p/gdata-python-client/issues/detail?id=693

As of 4/1/2014 I'm no longer able to get contacts via the python gdata
library.

I'm using version 2.0.18 of the python gdata library distributed with
Ubuntu. Here is my script:

#!/usr/bin/env python

import gdata.contacts.service

gd_client = gdata.contacts.service.ContactsService()
gd_client.ClientLogin('user', 'password')

query = gdata.contacts.service.ContactsQuery()
query.max_results = 1000 # change for max contacts returned

feed = gd_client.GetContactsFeed(query.ToUri())
print feed

Here is the error that I get:

Traceback (most recent call last):
File "/home/jpschewe/bin/export-gcontact.py", line 11, in <module>
feed = gd_client.GetContactsFeed(query.ToUri())
File "/usr/lib/python2.7/dist-packages/gdata/contacts/service.py", line
104, in GetContactsFeed
return self.Get(uri, converter=gdata.contacts.ContactsFeedFromString)
File "/usr/lib/python2.7/dist-packages/gdata/service.py", line 1107, in
Get
'reason': server_response.reason, 'body': result_body}
gdata.service.RequestError: {'status':
301, 'body': '<HTML>\n<HEAD>\n<TITLE>Moved
Permanently</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF"
TEXT="#000000">\n<H1>Moved Permanently</H1>\nThe document has moved <A
HREF="https://www.google.com/m8/feeds/contacts/default/full?max-results=1000">here</A>.\n</BODY>\n</HTML>\n', 'reason': 'Moved
Permanently'}
ERROR: Error getting contacts

Trying to visit the URL in my web browser gives a 404.


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

gdata-pyt...@googlecode.com

unread,
Apr 3, 2014, 4:16:29 PM4/3/14
to gdata-python-client-...@googlegroups.com

Comment #1 on issue 693 by ericmayc...@gmail.com: Can't access contact
information anymore
http://code.google.com/p/gdata-python-client/issues/detail?id=693

I am having this issue as well. From the Google Data Contacts API webpage:

Important: As of March 31, 2014, in order to increase security, the
Contacts API began redirecting HTTP GET requests to HTTPS, and rejecting
POST, PUT, and DELETE requests made with HTTP. If your application uses the
HTTP protocol, please switch to HTTPS. More information.

Anyway to tell the gdata python client to use https?

gdata-pyt...@googlecode.com

unread,
Apr 3, 2014, 5:15:59 PM4/3/14
to gdata-python-client-...@googlegroups.com

Comment #2 on issue 693 by ad...@rentahomeidaho.com: Can't access contact
information anymore
http://code.google.com/p/gdata-python-client/issues/detail?id=693

I have discovered a work around for the issue. If you edit line 1088 of

gdata-2.0.18/src/gdata/services.py

from

elif server_response.status == 302:

to

elif server_response.status == 302 or server_response.status == 301:

and then reinstall with

python setup.py install

It will allow the redirect to be followed and for your script to complete.

gdata-pyt...@googlecode.com

unread,
Apr 3, 2014, 5:17:08 PM4/3/14
to gdata-python-client-...@googlegroups.com

Comment #3 on issue 693 by ericmayc...@gmail.com: Can't access contact

gdata-pyt...@googlecode.com

unread,
Apr 3, 2014, 9:59:06 PM4/3/14
to gdata-python-client-...@googlegroups.com

Comment #4 on issue 693 by jpsch...@gmail.com: Can't access contact
information anymore
http://code.google.com/p/gdata-python-client/issues/detail?id=693

Thank you for that patch. That works nicely even without reinstall. One can
edit the file in place.

gdata-pyt...@googlecode.com

unread,
Apr 4, 2014, 2:51:32 AM4/4/14
to gdata-python-client-...@googlegroups.com

Comment #5 on issue 693 by jzapa...@gmail.com: Can't access contact
information anymore
http://code.google.com/p/gdata-python-client/issues/detail?id=693

Same issue, thanks.

gdata-pyt...@googlecode.com

unread,
May 10, 2014, 5:49:13 AM5/10/14
to gdata-python-client-...@googlegroups.com

Comment #6 on issue 693 by sergio.m...@gmail.com: Can't access contact
information anymore
http://code.google.com/p/gdata-python-client/issues/detail?id=693

Same issue here.

All working fine again with the solution proposed by Eric.

Thank you very much.

gdata-pyt...@googlecode.com

unread,
Jul 21, 2014, 3:54:25 PM7/21/14
to gdata-python-client-...@googlegroups.com

Comment #7 on issue 693 by lya...@gmail.com: Can't access contact
information anymore
http://code.google.com/p/gdata-python-client/issues/detail?id=693

Small note. Release 2.0.18 doesn't seem to be tagged in Mercurial.

gdata-pyt...@googlecode.com

unread,
Dec 5, 2014, 5:22:03 AM12/5/14
to gdata-python-client-...@googlegroups.com

Comment #8 on issue 693 by nic...@gmail.com: Can't access contact
information anymore
https://code.google.com/p/gdata-python-client/issues/detail?id=693

I've been hit by this problem too.

Applying this patch (a tidier version of the above fix) fixes it. Could
this be applied please? Contacts is unusable without it.

See attached.





Attachments:
gdata-contacts-fix.patch 497 bytes

gdata-pyt...@googlecode.com

unread,
Dec 30, 2014, 4:34:08 PM12/30/14
to gdata-python-client-...@googlegroups.com

Comment #9 on issue 693 by afs...@google.com: Can't access contact
information anymore
https://code.google.com/p/gdata-python-client/issues/detail?id=693

Isn't it a better patch to just use the https URL?

gdata-pyt...@googlecode.com

unread,
Dec 31, 2014, 11:48:54 AM12/31/14
to gdata-python-client-...@googlegroups.com

Comment #10 on issue 693 by nic...@gmail.com: Can't access contact
information anymore
https://code.google.com/p/gdata-python-client/issues/detail?id=693

Yes the https URL would be a better fix. I'd be happy to test a patch if
you have one.

gdata-pyt...@googlecode.com

unread,
Dec 31, 2014, 11:49:54 AM12/31/14
to gdata-python-client-...@googlegroups.com

Comment #11 on issue 693 by nic...@gmail.com: Can't access contact

gdata-pyt...@googlecode.com

unread,
Dec 31, 2014, 12:03:36 PM12/31/14
to gdata-python-client-...@googlegroups.com

Comment #12 on issue 693 by ericmayc...@gmail.com: Can't access contact
information anymore
https://code.google.com/p/gdata-python-client/issues/detail?id=693

I think I went down that road when I first encountered this problem, but
could not get the https URL to work correctly.

As stated, if you want to take a stab at it, that would be great . . . but
the proposed solution has been working flawlessly for me for the last
several months.

gdata-pyt...@googlecode.com

unread,
Jan 1, 2015, 9:43:34 AM1/1/15
to gdata-python-client-...@googlegroups.com

Comment #13 on issue 693 by lya...@gmail.com: Can't access contact
information anymore
https://code.google.com/p/gdata-python-client/issues/detail?id=693

I thing I also tried the https path. As I recall it got troublesome with
HTTPS and the fact that Google redirects. It seems like A good solution
though, I would like to see a patch.
Reply all
Reply to author
Forward
0 new messages