AmEv7Fam / familysearch-python-sdk-opensource

WIP Python SDK for FamilySearch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't login with Python 2.7

mtdcr opened this issue · comments

commented

When trying to log in with Python 2.7 (with 3233262 applied), I get urllib2.HTTPError: HTTP Error 400: Bad Request. This doesn't happen when running the same code with 3.4.

from familysearch import FamilySearch

fs = FamilySearch(user_agent, app_key, base='https://sandbox.familysearch.org')
fs.unauthenticated_login(ip)

params = {
    'givenName': 'John',
    'surname': 'Doe',
    'fatherGivenName': 'John',
    'fatherSurname': 'Doe',
}

headers = {
    'Accept': 'application/x-gedcomx-atom+json'
}

q = ' '.join(['%s:%s' % (key, val) for key, val in params.items()])

fs.get(fs.person_search(q=q), headers=headers)
commented

Python 2.7. Ugh.