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

batch remote-create error because of id=None #35

Closed
linpingta opened this issue Mar 7, 2015 · 3 comments
Closed

batch remote-create error because of id=None #35

linpingta opened this issue Mar 7, 2015 · 3 comments

Comments

@linpingta
Copy link

Hi guys,

Thanks a lot for making this, but I meet one error when do batch remote_create of campaign/adset/ads and I am not sure whether it's a mistake.

My code like:

api_batch = api.new_batch()

 // def callback function

campaign.update({
    AdCampaign.Field.name: 'Seattle Ad Campaign',
    AdCampaign.Field.objective: AdCampaign.Objective.website_clicks,
    AdCampaign.Field.status: AdCampaign.Status.paused,
})

campaign.remote_create(batch=api_batch,success=callback_success,failure=callback_failure)

api.execute()

And it raises error like:

Traceback (most recent call last):
  File "create_ad.py", line 164, in <module>
   campaign.remote_create(batch=api_batch,success=callback_success,failure=callback_failure)
  File "/home/chutong/fb_api_test/facebookads/objects.py", line 529, in remote_create
    failure=callback_failure,
  File "/home/chutong/fb_api_test/facebookads/api.py", line 373, in add
    keyvals.append("%s=%s" % (key, urllib.parse.quote(params[key])))
  File "/usr/local/lib/python2.7/urllib.py", line 1225, in quote
    raise TypeError('None object cannot be quoted')
  TypeError: None object cannot be quoted

The reason is in

    for key in params:
            keyvals.append("%s=%s" % (key, urllib.parse.quote(params[key])))

params contains key='id' which has value None, it couldn't be treated as string here.

Should a judgement for value added here or do I make a wrong usage of batch remote create here?

Thanks for your help.

@m-vdb
Copy link

m-vdb commented May 13, 2015

duplicate of #30, but I think it's an actual bug

@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

@rituparnamukherjee
Copy link
Contributor

Closing this out. WIll track with #30

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