Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't pickle CompiledFFI objects #413

Closed
lmatheus opened this issue Jun 17, 2019 · 2 comments
Closed

can't pickle CompiledFFI objects #413

lmatheus opened this issue Jun 17, 2019 · 2 comments
Assignees

Comments

@lmatheus
Copy link

Hello. I'm trying to get account data but getting an error:

This is an example of the code I am using:

from googleads import oauth2

path_to_file='XXXXXXX'
application_name = "AAAAAAAA"


# Initialize the GoogleRefreshTokenClient using the credentials you received
# in the earlier steps.
oauth2_client = oauth2.GoogleServiceAccountClient(
    key_file, oauth2.GetAPIScope('adwords'))


# Initialize the Ad Manager client.
client = adwords.AdWordsClient(oauth2_client, application_name)

selector = {
   'fields': ['CustomerId', 'CanManageClients']
}

# get accounts
accounts = client.GetService('ManagedCustomerService').get(selector)

Full error:

Traceback (most recent call last):
File "module-folder/integrations/google_adwords.py", line 48, in
convert_lead()
File "module-folder/integrations/google_adwords.py", line 45, in convert_lead
accounts = service.get(selector)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/site-packages/googleads/common.py", line 994, in MakeSoapRequest
*packed_args, _soapheaders=soap_headers)['body']['rval']
File "/home/user/.virtualenvs/project-folder/lib/python3.7/site-packages/zeep/proxy.py", line 45, in call
kwargs,
File "/home/user/.virtualenvs/project-folder/lib/python3.7/site-packages/zeep/wsdl/bindings/soap.py", line 119, in send
operation, args, kwargs, client=client, options=options
File "/home/user/.virtualenvs/project-folder/lib/python3.7/site-packages/zeep/wsdl/bindings/soap.py", line 68, in _create
serialized = operation_obj.create(*args, **kwargs)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/site-packages/zeep/wsdl/definitions.py", line 215, in create
return self.input.serialize(*args, **kwargs)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/site-packages/zeep/wsdl/messages/soap.py", line 59, in serialize
header = self._serialize_header(headers_value, nsmap)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/site-packages/zeep/wsdl/messages/soap.py", line 326, in _serialize_header
headers_value = copy.deepcopy(headers_value)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 161, in deepcopy
y = copier(memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/site-packages/zeep/xsd/valueobjects.py", line 151, in deepcopy
new.values = copy.deepcopy(self.values)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 306, in _reconstruct
value = deepcopy(value, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 180, in deepcopy
y = _reconstruct(x, memo, *rv)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 280, in _reconstruct
state = deepcopy(state, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 150, in deepcopy
y = copier(x, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 240, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/home/user/.virtualenvs/project-folder/lib/python3.7/copy.py", line 169, in deepcopy
rv = reductor(4)
TypeError: can't pickle CompiledFFI objects

This might be related to #397

@BenRKarl
Copy link
Contributor

Hi @lmatheus thanks for the question and apologies for my delayed response. As with #397 I'm not exactly sure what the issue is here so I'll need to do some investigating. Meanwhile could you let me know what version of Python you're using and what the context of running pip freeze are?

@BenRKarl BenRKarl self-assigned this Jun 28, 2019
@christopherseeley
Copy link
Member

Duplicate of #397

@christopherseeley christopherseeley marked this as a duplicate of #397 Mar 28, 2024
@christopherseeley christopherseeley closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants