AmEv7Fam/familysearch-python-sdk-opensource

Can't login with Python 2.7

mtdcr opened this issue · 1 comments

mtdcr 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)
mtdcr commented

Python 2.7. Ugh.