googleads-python-lib icon indicating copy to clipboard operation
googleads-python-lib copied to clipboard

"Can't pickle SSLContext objects" on requests

Open loganbibby opened this issue 7 years ago • 1 comments

I'm running a tutorial-level script on a python:3.7-buster Docker instance (but I'm getting the same error running 3.7 on Windows 10).

oauth2_client = oauth2.GoogleServiceAccountClient("google_auth.json", oauth2.GetAPIScope('ad_manager'))
client = adwords.AdWordsClient(oauth2_client, "xxxx")
targeting_idea_service = client.GetService('TargetingIdeaService', version='v201809')

<insert selector dict building here>

more_pages = True
    while more_pages:
        page = targeting_idea_service.get(selector)

At the targeting_idea_server.get(selector) line is where the whole thing blows up with TypeError: can't pickle SSLContext objects. Initially, I read that the error was possibly caused by Python's multi-threading on Windows, so that's when I moved it into the Docker container and got the same result.

I've gone back a couple of versions and run into the same issue.

What am I doing wrong?

loganbibby avatar Oct 28 '19 16:10 loganbibby

Hi @sp0rkie I believe this issue was resolved in a separate thread, please see: https://github.com/googleads/googleads-python-lib/issues/468

BenRKarl avatar Jul 08 '20 18:07 BenRKarl